From 98a0ebbe0ad225475c1001746e8188ec03446bfb Mon Sep 17 00:00:00 2001 From: Shubham Date: Sat, 18 Apr 2026 10:07:04 +0530 Subject: [PATCH] sync-client.md: Add SyncChangeListener docs for Swift library --- sync-client.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sync-client.md b/sync-client.md index dba5f17..85135b5 100644 --- a/sync-client.md +++ b/sync-client.md @@ -1210,7 +1210,24 @@ syncClient.setSyncChangeListener(null) {% endtab %} {% tab title="Swift" %} -_Coming soon!_ +```swift +import ObjectBox + +class MyChangeListener: SyncChangeListener { + func changed(_ changes: [obx_schema_id : SyncChange]) { + for (schemaId, change) in changes { + // schemaId identifies the entity for which the changes were recorded + // change.puts is an [Id] containing the ids of objects + // that were created/updated + // change.removals is an [Id] containing the ids of objects + // that were removed/deleted + } + } +} + +// set the listener when building the client +client.changeListener = MyChangeListener() +``` {% endtab %} {% tab title="Dart/Flutter" %}