So to prevent writing duplicates into CloudKit, I run this CKQuery
first, and if no matches come back, I create a new record.
let predicate = NSPredicate(format: "%K == %@", recordField, recordValue)
let query = CKQuery(recordType: recordType, predicate: predicate)
CloudKit
Saturday July 22, 2023