Last active
January 27, 2017 17:36
-
-
Save roymckenzie/0905cbdd50ffd085402542128fc4d32d to your computer and use it in GitHub Desktop.
Private Database Subscription
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
import CloudKit | |
// Create subscription with an internal identifier | |
let subscription = CKDatabaseSubscription(subscriptionID: "internalSubscriptionIdentifier") | |
// Create an operation to save the subscription | |
let operation = CKModifySubscriptionsOperation(subscriptionsToSave: [subscription], | |
subscriptionIDsToDelete: nil) | |
// Add the operation to the private database | |
CKContainer.default() | |
.privateCloudDatabase | |
.add(operation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment