subscriptions = subscriptions else { return } guard subscriptions.isEmpty else { return } let predicate = NSPredicate(value: true) let querySubscription = CKQuerySubscription( recordType: "Notes", predicate: predicate, options: [ .firesOnRecordCreation, .firesOnRecordUpdate, .firesOnRecordDeletion ]) let notification = CKNotificationInfo() notification.alertBody = "A note was changed or deleted" notification.shouldBadge = true notification.shouldSendContentAvailable = true querySubscription.notificationInfo = notification self.privateCloudDatabase.save(querySubscription) { subscription, error in // Check Error } } @available(iOS 10.0, *) public struct CKQuerySubscriptionOptions : OptionSet { public init(rawValue: UInt) public static var firesOnRecordCreation: CKQuerySubscriptionOptions { get } public static var firesOnRecordUpdate: CKQuerySubscriptionOptions { get } public static var firesOnRecordDeletion: CKQuerySubscriptionOptions { get } public static var firesOnce: CKQuerySubscriptionOptions { get } }