CoreDataStack

open class CoreDataStack<T> where T : NSPersistentContainer

Undocumented

  • Undocumented

    Declaration

    Swift

    public typealias AvailableNotification = CachedValueTypedNotification<NSManagedObjectContext>
  • Notification that will be emitted when the persistent container is available to use.

    Declaration

    Swift

    public let availableNotification: AvailableNotification
  • The context associated with all managed objects from the persistent container

    Declaration

    Swift

    public var managedObjectContext: NSManagedObjectContext? { get }
  • The managed object context that works safely with the main thread.

    Declaration

    Swift

    public lazy var mainContext: NSManagedObjectContext { get set }
  • Construct a new Core Data stack that will provide values from a given persistent container

    Declaration

    Swift

    public required init(container: T)

    Parameters

    container

    the container to work with

  • Save any changes in main managed object context. NOTE: better to do this from NSManagedObject context.

    Declaration

    Swift

    public func saveChanges()