DefaultCoreDataStackProvider
Can create new Core Data stacks, corresponding to CloudKit record zones. Used by CloudKitSynchronizer
to dynamically create stacks when new record zones are added to this user's database –e.g. if the user accepts a share.
@objc public class DefaultCoreDataStackProvider: NSObject
#
InheritanceAdapterProvider
, NSObject
#
Initializersinit(identifier:storeType:model:appGroup:)
#
Create a new Core Data stack provider
@objc public init(identifier: String, storeType: String, model: NSManagedObjectModel, appGroup: String? = nil)
#
Parameters- identifier: Identifier for this provider. Once created, an identifier must remain the same for a given provider
- storeType: Core Data store type.
- model: Core Data model.
- appGroup: Optional app group identifier.
#
Propertiesidentifier
#
This provider's identifier.
@objc public let identifier: String
storeType
#
Core Data store type.
@objc public let storeType: String
model
#
Core Data model.
@objc public let model: NSManagedObjectModel
appGroup
#
App group, if any.
@objc public let appGroup: String?
adapterDictionary
#
Current list of adapters maintained by this adapter provider.
@objc public private(set) var adapterDictionary: [CKRecordZone.ID: CoreDataAdapter]
coreDataStacks
#
Current list of Core Data stacks maintained by this adapter provider.
@objc public private(set) var coreDataStacks: [CKRecordZone.ID: CoreDataStack]
directoryURL
#
URL of the folder where data by this provider is saved.
@objc public private(set) var directoryURL: URL!
#
MethodscloudKitSynchronizer(_:modelAdapterForRecordZoneID:)
#
public func cloudKitSynchronizer(_ synchronizer: CloudKitSynchronizer, modelAdapterForRecordZoneID zoneID: CKRecordZone.ID) -> ModelAdapter?
cloudKitSynchronizer(_:zoneWasDeletedWithZoneID:)
#
public func cloudKitSynchronizer(_ synchronizer: CloudKitSynchronizer, zoneWasDeletedWithZoneID zoneID: CKRecordZone.ID)