public struct CoreDataStackProvider
extension CoreDataStackProvider: Equatable
An instance of
CoreDataStackProvider is responsible for creating instances of
Because the adding of the persistent store to the persistent store coordinator during initialization
CoreDataStack can take an unknown amount of time, you should not perform this operation on the main queue.
See this guide for more details.
WarningYou should not create instances of
CoreDataStackdirectly. Use a
Describes the initialization options for a persistent store.
public typealias PersistentStoreOptions = [AnyHashable : Any]
Describes default persistent store options.
public static let defaultStoreOptions: PersistentStoreOptions
The model for the stack that the factory produces.
public let model: CoreDataModel
A dictionary that specifies options for the store that the factory produces. The default value is
public let options: PersistentStoreOptions?
The model describing the stack.
Options for the persistent store.
If a queue is provided, this operation is performed asynchronously on the specified queue, and the completion closure is executed asynchronously on the main queue. If
nil, then this method and the completion closure execute synchronously on the current queue.
public func createStack(onQueue queue: DispatchQueue? = .global(qos: .userInitiated), completion: @escaping (CoreDataStack.StackResult) -> Void)
The queue on which to initialize the stack. The default is a background queue with a “user initiated” quality of service class. If passing
nil, this method is executed synchronously on the queue from which the method was called.
The closure to be called once initialization is complete. If a queue is provided, this is called asynchronously on the main queue. Otherwise, this is executed on the thread from which the method was originally called.