CoreStore v6.0.0 Release Notes

Release Date: 2019-01-23 // about 5 years ago
  • ⚡️ ⚠️This update will break current code. Make sure to read the changes below:

    💥 Breaking changes

    • 🚀 Minimum Deployment Version is raised to iOS 10, macOS 10.12, tvOS 10, watchOS 3
    • 🗄 ICloudStore and ICloudStoreObservers are now officially deprecated (iCloud Core Data had been deprecated quite a long time ago).
    • ⏪ Fetching and Querying methods now throws an error of type CoreStoreError.persistentStoreNotFound(DynamicObject.Type) when the specified entity does not exist in any storage. This is to distinguish difference between non-existing objects versus non-existing stores.

      // Beforeif let object = CoreStore.fetchOne(...) { // ...}else { // May be nil because addStorage() hasn't completed yet or because nothing really matches the query}

      // Afterdo { if let object = try CoreStore.fetchOne(...) { // ... } else { // addStorage() has completed but nothing matches the query } }catch { // method was called before addStorage() completed}

    If you are sure you won't encounter cases where fetches happen before a storage is added to the DataStack, simply add try! to your fetch*() and query*() method calls.

    Conveniences

    • CoreStoreObjects (as well as their PartialObject counterparts) now conform to CustomDebugStringConvertable by default.
    • CoreStoreObjects now assert on property names that possibly collide with reserved names such as description
    • CoreStoreObject properties can now be observed individually without the need for ObjectMonitors. The API is a bit similar to the standard KVO API:

      // NSManagedObjectlet observer = person.observe(.friends, options: [.new, .old]) { (person, change) in// ...} // CoreStoreObjectlet observer = person.friends.observe(options: [.new, .old]) { (person, change) in// ...}

    You may still use ObjectMonitors especially for observing multiple changes at once.

    • 🏗 CoreStore now has its own Playgrounds file! You can find this at the top of the workspace (run pod try CoreStore if you don't have it locally). You will need to build the CoreStore iOS schema at least once to create the framework used by the Playgrounds.

    👌 Improvements

    • 🛠 Fixed queue assertion for UnsafeDataTransactions (#275)
    • 🐎 ListMonitor access performance boost (#287, #288)
    • ➕ Added a new CoreStoreError.asynchronousMigrationRequired(URL) for cases when addStorageAndWait() is used together with .allowSynchronousLightweightMigration but migrations are only allowed asynchronously (#277)
    • CoreStore docs are now powered by jazzy
    • 🛠 Fixed issue with InferredSchemaMappingProvider not respecting renaming identifiers (#301)