Created
December 31, 2014 00:42
-
-
Save nathanborror/008a28434c5a36cf9ae0 to your computer and use it in GitHub Desktop.
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
func subscribe() { | |
let subscription = CKSubscription(recordType: "Item", predicate: NSPredicate(value: true), subscriptionID: "items", options: .FiresOnRecordUpdate | .FiresOnRecordCreation) | |
subscription.notificationInfo = CKNotificationInfo() | |
subscription.notificationInfo.alertBody = "New item added" | |
self.db.saveSubscription(subscription) { (subscription, error) -> Void in | |
if error != nil { | |
println(error.localizedDescription) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment