Skip to content

Instantly share code, notes, and snippets.

@MarcusSmith
Created February 22, 2016 21:56
Show Gist options
  • Save MarcusSmith/565deb33c88466b9e797 to your computer and use it in GitHub Desktop.
Save MarcusSmith/565deb33c88466b9e797 to your computer and use it in GitHub Desktop.
Create new CKOperation and make it long lived
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