Created
February 22, 2016 21:56
-
-
Save MarcusSmith/565deb33c88466b9e797 to your computer and use it in GitHub Desktop.
Create new CKOperation and make it long lived
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let operation = CKModifyRecordsOperation(recordsToSave: largeRecords, recordIDsToDelete: nil) | |
operation.longLived = true | |
operation.longLivedOperationWasPersistedBlock = { | |
print("Operation with ID", operation.operationID, "was persisted") | |
} | |
operation.modifyRecordsCompletionBlock = { (savedRecords, _, error) in | |
print("Operation with ID", operation.operationID, "saved records", savedRecords, "error", error) | |
} | |
CKContainer.defaultContainer().publicCloudDatabase.addOperation(operation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment