This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
Releases: 3lvis/DATAStack
Releases · 3lvis/DATAStack
DATAStack — 5.4.0
- Adds a new background context that doesn't block the UI since it doesn't merge it's content with the main thread when saving.
/**
Returns a background context perfect for data mutability operations. Make sure to never use it on the main thread. Use `performBlock` or `performBlockAndWait` to use it.
Saving to this context doesn't merge with the main thread. This context is specially useful to run operations that don't block the main thread. To refresh your main thread objects for
example when using a NSFetchedResultsController use `try self.fetchedResultsController.performFetch()`.
*/
public func newNonMergingBackgroundContext() -> NSManagedObjectContext {
let context = NSManagedObjectContext(concurrencyType: DATAStack.backgroundConcurrencyType())
context.persistentStoreCoordinator = self.persistentStoreCoordinator
context.undoManager = nil
context.mergePolicy = NSMergeByPropertyStoreTrumpMergePolicy
return context
}
DATAStack — 5.3.2
- Rollback changes in 5.3.1, basically it goes back to 5.3.0
DATAStack — 5.3.1
Nevermind, this will be rolledback in 5.3.2
DATAStack — 5.3.0
- Added a new initializer to start a DATAStack instance using a containerURL
public init(modelName: String, bundle: NSBundle, storeType: DATAStackStoreType, storeName: String, containerURL: NSURL)
- Improved compatibility with NSPersistentContainer, so hopefully is easier to migrate once iOS 10 becomes more widely adopted.
public var viewContext: NSManagedObjectContext
public func performBackgroundTask(operation: (backgroundContext: NSManagedObjectContext) -> Void)
DATAStack — 6.0.0 (Beta 1)
Swift 3 migration.
DATAStack — 5.2.1
DATAStack — 5.2.0
Removed
/**
Most of the time when saving a background context you want that it merges the saved changes with the main
context, but when you're performing partial savings, such as batch saves you don't want this to be the case.
- parameter context: The block that contains the created background context.
*/
public func saveBackgroundContextWithoutMergingWithMainContext(context: NSManagedObjectContext) throws
DATAStack — 5.1.0
Added
/**
Most of the time when saving a background context you want that it merges the saved changes with the main
context, but when you're performing partial savings, such as batch saves you don't want this to be the case.
- parameter context: The block that contains the created background context.
*/
public func saveBackgroundContextWithoutMergingWithMainContext(context: NSManagedObjectContext) throws
DATAStack — 5.0.0
I'm not sure why some people were mutating data on the main thread, but this one goes for them
- Refactored all the things to have better error handling and better code coverage
- Added a new method to create a background context, super useful when doing saves with NSOperations
public func newBackgroundContext() -> NSManagedObjectContext
BREAKING CHANGE
- Removed the need to call
persistWithCompletion
orpersist
, 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 {
}
- Now
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, useforceDrop()
instead
Before:
dataStack.drop()
After:
try dataStack.drop()
DATAStack — 4.3.0
- Ability to drop entities, moved to SweetCoreData: #41
- Added error to
persistWithCompletion
and renamed topersist
: #50 - Improved documentation: c045ec4
- Moved TestCheck: 426dfd9
Thanks a lot to @justinmakaila for his help in making this release real. Open source is great because of people like him.