What is CoreStore?

Why use CoreStore?

CoreStore was (and is) heavily shaped by real-world needs of developing data-dependent apps. It enforces safe and convenient Core Data usage while letting you take advantage of the industry’s encouraged best practices.

Features

  • Tight design around Swift’s code elegance and type safety. CoreStore fully utilizes Swift’s community-driven language features.
  • Safer concurrency architecture. CoreStore makes it hard to fall into common concurrency mistakes. The main NSManagedObjectContext is strictly read-only, while all updates are done through serial transactions. (See Saving and processing transactions)
  • Clean fetching and querying API. Fetching objects is easy, but querying for raw aggregates (min, max, etc.) and raw property values is now just as convenient. (See Fetching and querying)
  • Type-safe, easy to configure observers. You don’t have to deal with the burden of setting up NSFetchedResultsControllers and KVO. As an added bonus, ListMonitors and ObjectMonitors can have multiple observers. This means you can have multiple view controllers efficiently share a single resource! (See Observing changes and notifications)
  • Efficient importing utilities. Map your entities once with their corresponding import source (JSON for example), and importing from transactions becomes elegant. Uniquing is also done with an efficient find-and-replace algorithm. (See Importing data)
  • Say goodbye to .xcdatamodeld files! The new CoreStoreObject is the replacement to NSManagedObject. CoreStoreObject subclasses can declare type-safe properties all in Swift code, no need to maintain separate resource files for the models. As bonus, these special properties support custom types, and can be used to create type-safe keypaths and queries. (See Type-safe CoreStoreObjects)
  • Progressive migrations. No need to think how to migrate from all previous model versions to your latest model. Just tell the DataStack the sequence of version strings (MigrationChains) and CoreStore will automatically use progressive migrations when needed. (See Migrations)
  • Easier custom migrations. Say goodbye to .xcmappingmodel files; CoreStore can now infer entity mappings when possible, while still allowing an easy way to write custom mappings. (See Migrations)
  • Plug-in your own logging framework. Although a default logger is built-in, all logging, asserting, and error reporting can be funneled to CoreStoreLogger protocol implementations. (See Logging and error reporting)
  • Heavy support for multiple persistent stores per data stack. CoreStore lets you manage separate stores in a single DataStack, just the way .xcdatamodeld configurations are designed to. CoreStore will also manage one stack by default, but you can create and manage as many as you need. (See Setting up)
  • Free to name entities and their class names independently. CoreStore gets around a restriction with other Core Data wrappers where the entity name should be the same as the NSManagedObject subclass name. CoreStore loads entity-to-class mappings from the managed object model file, so you can assign different names for the entities and their class names.
  • Full Documentation. No magic here; all public classes, functions, properties, etc. have detailed Apple Docs. This README also introduces a lot of concepts and explains a lot of CoreStore’s behavior.
  • Informative (and pretty) logs. All CoreStore and Core Data-related types now have very informative and pretty print outputs! (See Logging and error reporting)
  • Objective-C support! Is your project transitioning from Objective-C to Swift but still can’t quite fully convert some huge classes to Swift yet? CoreStore adjusts to the ever-increasing Swift adoption. While still written in pure Swift, all CoreStore types have their corresponding Objective-C-visible “bridging classes”. (See Objective-C support)
  • More extensive Unit Tests. Extending CoreStore is safe without having to worry about breaking old behavior

Overview

  • Pricing: Free
  • Resource Link: https://github.com/JohnEstropia/CoreStore
  • Resource Maker on Twitter: John Estropia
  • Mobile Platform Destination: iOS Apps
  • Mobile Platform Support: Native iOS
  • Programming Languages: Swift
  • iOS Versions Supported: iOS 9.0+, iOS 10.0+, iOS 11.0+, iOS 12.0+
  • CocoaPods: CoreStore
  • Carthage: JohnEstropia/CoreStore