The following classes are available globally.
An instance of
CoreDataStackencapsulates the entire Core Data stack. It manages the managed object model, the persistent store coordinator, and managed object contexts.
It is composed of a main context and a background context. These two contexts operate on the main queue and a private background queue, respectively. Both are connected to the persistent store coordinator and data between them is perpetually kept in sync.
Changes to a child context are propagated to its parent context and eventually the persistent store when saving.
WarningYou cannot create a
CoreDataStackinstance directly. Instead, use a
public final class CoreDataStack
extension CoreDataStack: Equatable
extension CoreDataStack: CustomStringConvertible