Sync — 1.9.0
Add support for operation types
Adds support for selecting different operation types, so far Sync has being inserting items found in JSON but not locally, removing items found locally but not in JSON and updating items found both in JSON and locally. This vesion allows you to change that, so you can choose to just insert, just delete, just update or any combination of those things.
PR: #223
let firstImport = // First import of users
Sync.changes(firstBatch, inEntityNamed: "User", dataStack: dataStack, operations: [.All]) {
// All users have been imported, they are happy
}
// Likely after some changes have happened, here usually Sync would remove the not found items
let secondImport = // Second import of users
Sync.changes(secondImport, inEntityNamed: "User", dataStack: dataStack, operations: [.Insert, .Update]) {
// Here new users have been imported, existing users have been updated, and not found users have been ignored
}
Others
- Improved multithreading safety