如何使用CKNotification?

时间:2019-01-06 23:17:48

标签: ios swift cloudkit cksubscription

我想在cloudkit上的值更改时收到通知

这是我的代码:

let now = Date()
    let timeInterval:TimeInterval = now.timeIntervalSince1970
    let timeStamp = Int(timeInterval)
let publicDB = CKContainer.default().publicCloudDatabase
    let bookID = CKRecord.ID(recordName: "\(timeStamp)")
    let book = CKRecord(recordType: "Book", recordID: bookID)

1 个答案:

答案 0 :(得分:-1)

我通过定期询问解决了这个问题。