How to Use CKNotification?

100 Views Asked by At

I want to be notified when the value changes on cloudkit

this is my code:

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

There are 1 best solutions below

1
ZhangCheng On BEST ANSWER

I solved the problem by asking regularly.