Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Releases: 3lvis/DATAStack

DATAStack — 5.4.0

31 Jul 15:40
Compare
Choose a tag to compare
  • 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

31 Jul 15:32
Compare
Choose a tag to compare
  • Rollback changes in 5.3.1, basically it goes back to 5.3.0

DATAStack — 5.3.1

31 Jul 14:05
Compare
Choose a tag to compare

Nevermind, this will be rolledback in 5.3.2

DATAStack — 5.3.0

17 Jul 08:24
Compare
Choose a tag to compare
  • 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)

29 Jun 14:35
Compare
Choose a tag to compare
Pre-release

Swift 3 migration.

DATAStack — 5.2.1

16 May 05:25
Compare
Choose a tag to compare
  • Fixed a bug where fetchBatchSize would be ignored when using NSFetchedResultsController #60

Thanks to @zarv1k for reporting this bug and for being so responsive to feedback 👏

DATAStack — 5.2.0

15 May 10:46
Compare
Choose a tag to compare

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

15 May 08:02
Compare
Choose a tag to compare

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

08 May 21:41
Compare
Choose a tag to compare

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 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 {

}
  • 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, use forceDrop() instead

Before:

dataStack.drop()

After:

try dataStack.drop()

DATAStack — 4.3.0

28 Apr 20:01
Compare
Choose a tag to compare
  • Ability to drop entities, moved to SweetCoreData: #41
  • Added error to persistWithCompletion and renamed to persist: #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.