Bot releases are hidden (Show)
Published by 3lvis over 8 years ago
Release notes from DATAStack here:
public func newBackgroundContext() -> NSManagedObjectContext
persistWithCompletion
or persist
, you just need to save your used context and magic will happen// Just kill this babies, they are no longer needed
dataStack.persist {error in
}
dataStack.persistWithCompletion {
}
drop()
throws, before it was hiding the error message but now you can deal with that. If you're an Objective-C user this will no work for you, use forceDrop()
insteadBefore:
dataStack.drop()
After:
try dataStack.drop()
Published by 3lvis over 8 years ago
Thanks to @xTheRamon for reporting this issue 👏
Published by 3lvis over 8 years ago
Published by 3lvis over 8 years ago
Published by 3lvis over 8 years ago
Updated NSManagedObject-HYPPropertyMapper — 3.6.0, which now includes support for transformable types. Make sure to check the relevant pull request for more information.
@AlexKel kicks ass.
Published by 3lvis over 8 years ago
Thanks @wh33ler, you rock!
🎉 🎉 OMG OMG OMG 🎉 🎉
This comes thanks to @wainglaister who added this feature to NSManagedObject-HYPPropertyMapper. Fuck yeah!
Published by 3lvis over 8 years ago
🎉 🎉 OMG OMG OMG 🎉 🎉
This comes thanks to @wainglaister who added this feature to NSManagedObject-HYPPropertyMapper. Fuck yeah!
Published by 3lvis over 8 years ago
3.4.3
Published by 3lvis over 8 years ago
Published by 3lvis over 8 years ago
For example:
This comes thanks to the fantastic @wainglaister in #179. 👏 👏 👏 👏 👏 👏
Published by 3lvis over 8 years ago
Model.momd
then your data store would have been Model.sqlite
.Use the following initalizer to make use of this feature:
public init(modelName: String, bundle: NSBundle, storeType: DATAStackStoreType, storeName: String)
.momd
file but a single .mom
file.Published by 3lvis over 8 years ago
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)
})
}
Published by 3lvis over 8 years ago
Published by 3lvis over 8 years ago
Published by 3lvis over 8 years ago
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.
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!
Published by 3lvis over 8 years ago
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!
Published by 3lvis almost 9 years ago
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: https://github.com/hyperoslo/Sync/issues/140
And a couple of more issues that mentioned this: https://github.com/hyperoslo/Sync/issues/139 https://github.com/hyperoslo/Sync/issues/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!
Published by 3lvis almost 9 years ago
Published by 3lvis almost 9 years ago
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:
#import "DATASource.h
you would do @import DATASource;
Objective-C: Change DATAStackInMemoryStoreType
to DATAStackStoreTypeInMemory
, and change DATAStackSQLiteStoreType
to DATAStackStoreTypeSQLite
.
Swift: Change DATAStackInMemoryStoreType
to .InMemory
, and change DATAStackSQLiteStoreType
to .SQLite
.
Published by 3lvis almost 9 years ago
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:
#import "DATASource.h
you would do @import DATASource;
Objective-C: Change DATAStackInMemoryStoreType
to DATAStackStoreTypeInMemory
, and change DATAStackSQLiteStoreType
to DATAStackStoreTypeSQLite
.
Swift: Change DATAStackInMemoryStoreType
to .InMemory
, and change DATAStackSQLiteStoreType
to .SQLite
.