FetchAndSaveOperation
public class FetchAndSaveOperation: Operation
An operation that fetches data from CloudKit and saves it to Core Data, you can use it without calling CloudCore.fetchAndSave methods if you application relies on Operation
-
Private cloud database for the CKContainer specified by CloudCoreConfig
Declaration
Swift
public static let allDatabases = [ -
Called every time if error occurs
Declaration
Swift
public var errorBlock: ErrorBlock? -
Initialize operation, it’s recommended to set
errorBlockDeclaration
Swift
public init(from databases: [CKDatabase] = FetchAndSaveOperation.allDatabases, persistentContainer: NSPersistentContainer, tokens: Tokens = CloudCore.tokens)Parameters
databaseslist of databases to fetch data from (only private is supported now)
persistentContainerNSPersistentContainerthat will be used to save datatokenspreviously saved
Tokens, you can generate new ones if you want to fetch all data -
Performs the receiver’s non-concurrent task.
Declaration
Swift
override public func main()
FetchAndSaveOperation Class Reference