Releases: 3lvis/Sync
Sync — 1.5.1
- Update DATAStack dependency
DATAStack — 4.1.0
- Added support for having your data stores with different names, before if your model was
Model.momd
then your data store would have beenModel.sqlite
.
Use the following initalizer to make use of this feature:
public init(modelName: String, bundle: NSBundle, storeType: DATAStackStoreType, storeName: String)
- Added support for versioning out of the box, and also fix a crash when there is no
.momd
file but a single.mom
file.
Sync — 1.5.0
- Added an additional Sync method.
class func changes(changes: [[String : AnyObject]], inEntityNamed entityName: String, predicate: NSPredicate?, parent: NSManagedObject?, inContext context: NSManagedObjectContext, dataStack: DATAStack, completion: ((error: NSError?) -> Void)?)
This method is useful to control even more parts of Sync, for example if you want to use a special context that triggers notifications when an object gets changed.
For example:
self.dataStack.performInNewBackgroundContext { backgroundContext in
NSNotificationCenter.defaultCenter().addObserver(self, selector: "changeNotification:", name: NSManagedObjectContextObjectsDidChangeNotification, object: backgroundContext)
Sync.changes(json["data"] as! Array, inEntityNamed: "Data", predicate: nil, parent: nil, inContext: backgroundContext, dataStack: self.dataStack, completion: { error in
NSNotificationCenter.defaultCenter().removeObserver(self, name: NSManagedObjectContextObjectsDidChangeNotification, object: nil)
completion(error)
})
}
Sync — 1.4.3
- Updated dependencies with more nullability marks and with support for decimal number
Sync — 1.4.2
- Fixes a crash when mapping to-many ordered relationships (#176)
Sync — 1.4.1
1.4.1
In the API side of things, not much happened. We just hided a method that shouldn't have been exposed. Poor method.
Overall, we included documentation for ALL the methods, it might not be better than Apple's but it's a start. Apples to apples 🔫 🚪 .
Besides that, not all Sync should be in Swift, even the unit tests and helper methods.
Finally, the demo projects where moved to different repositories.
- Swift demo: https://github.com/3lvis/SyncAppNetDemo
- Objective-C demo: https://github.com/3lvis/SyncDesignerNewsDemo
Previously in 1.4.0
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!
Sync — 1.4.0
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!
Sync — 1.3.0
This is a nice one. Thanks to @tpmullan we got support for JSONs that only include the id of the relationship instead of the full JSON!
You can read more about this feature in the one-to-one simplified section in the README.
Also you can find the main issue that pointed to this: #140
And a couple of more issues that mentioned this: #139 #64
This is a pretty safe change, so nothing would need to change in your part, is just that Sync now is more awesome.
Have a great weekend and thanks again to @tpmullan!
Sync — 1.2.2
- Update DATAStack dependency (the latest release just includes an update to TestCheck 0.3.0
Sync — 1.2.1
- Updated DATAStack with a fix for a crash when running on the Apple TV.
Previously on 1.2.1
- Updated dependencies to support watchOS, OS X and tvOS.
Most dependencies only had minor changes, mostly adding support to the new platforms.
# https://github.com/3lvis/DATAFilter/releases/tag/0.9.1
s.dependency 'DATAFilter', '~> 0.9.1'
# https://github.com/3lvis/DATAStack/releases/tag/4.0.1
s.dependency 'DATAStack', '~> 4.0.1'
# https://github.com/3lvis/NSDictionary-ANDYSafeValue/releases/tag/0.3.1
s.dependency 'NSDictionary-ANDYSafeValue', '~> 0.3.1'
# https://github.com/hyperoslo/NSEntityDescription-SYNCPrimaryKey/releases/tag/0.1.1
s.dependency 'NSEntityDescription-SYNCPrimaryKey', '~> 0.1.1'
# https://github.com/hyperoslo/NSManagedObject-HYPPropertyMapper/releases/tag/3.3.3
s.dependency 'NSManagedObject-HYPPropertyMapper', '~> 3.3.3'
The biggest change relays in DATAStack which was rewritten in Swift.
This are the breaking changes:
Breaking changes in DATAStack 4.0.0
- Now you should use modules, so instead of
#import "DATASource.h
you would do@import DATASource;
- Renamed Enum + Improved Swift compatibility
Objective-C: Change DATAStackInMemoryStoreType
to DATAStackStoreTypeInMemory
, and change DATAStackSQLiteStoreType
to DATAStackStoreTypeSQLite
.
Swift: Change DATAStackInMemoryStoreType
to .InMemory
, and change DATAStackSQLiteStoreType
to .SQLite
.
Sync — 1.2.0
- Updated dependencies to support watchOS, OS X and tvOS.
Most dependencies only had minor changes, mostly adding support to the new platforms.
# https://github.com/3lvis/DATAFilter/releases/tag/0.9.1
s.dependency 'DATAFilter', '~> 0.9.1'
# https://github.com/3lvis/DATAStack/releases/tag/4.0.1
s.dependency 'DATAStack', '~> 4.0.1'
# https://github.com/3lvis/NSDictionary-ANDYSafeValue/releases/tag/0.3.1
s.dependency 'NSDictionary-ANDYSafeValue', '~> 0.3.1'
# https://github.com/hyperoslo/NSEntityDescription-SYNCPrimaryKey/releases/tag/0.1.1
s.dependency 'NSEntityDescription-SYNCPrimaryKey', '~> 0.1.1'
# https://github.com/hyperoslo/NSManagedObject-HYPPropertyMapper/releases/tag/3.3.3
s.dependency 'NSManagedObject-HYPPropertyMapper', '~> 3.3.3'
The biggest change relays in DATAStack which was rewritten in Swift.
This are the breaking changes:
Breaking changes in DATAStack 4.0.0
- Now you should use modules, so instead of
#import "DATASource.h
you would do@import DATASource;
- Renamed Enum + Improved Swift compatibility
Objective-C: Change DATAStackInMemoryStoreType
to DATAStackStoreTypeInMemory
, and change DATAStackSQLiteStoreType
to DATAStackStoreTypeSQLite
.
Swift: Change DATAStackInMemoryStoreType
to .InMemory
, and change DATAStackSQLiteStoreType
to .SQLite
.