Skip to content

Sync — 1.4.0

Compare
Choose a tag to compare
@3lvis 3lvis released this 21 Jan 13:04
· 866 commits to master since this release

A few critical parts of Sync were migrated to Swift, thanks to this now we have more type safety. Meaning, if something it's going on then Sync will either let you know at compiler time or just crash earlier, pointing the exact place where things didn't went as expected. For example if your relationships is missing a inverse relationship, now you will know that the problem is that, since now we have nullability marks everywhere.

First of all, you might need to update your Podfile, since now Sync includes some Swift code it's going to require you to add use_frameworks!. So now your Podfile will look like this:

use_frameworks!

pod 'Sync'

Now, let's continue with the other changes:

For Objective-C users, instead of using #import now you are going to have to use modules:

// Before
#import "Sync.h" 

// After
@import Sync; 

For Swift users, now the compiler is going to require you that your changes are [[String : AnyObject]] since that's what Sync requires, if you were already doing that then, no changes for you!

// Before
public class func changes(changes: NSArray, inEntityNamed entityName: String, dataStack: DATAStack, completion: ((error: NSError?) -> Void)?)

// After
public class func changes(changes: [[String : AnyObject]], inEntityNamed entityName: String, dataStack: DATAStack, completion: ((error: NSError?) -> Void)?)

Again, this is not really an API change, the API is really the same one as before. Everything is just a little bit safer.

Have a great day!