Swift 3.1, Xcode 8.3.3
I have a record type in CloudKit called Aircraft
and it has a field called fieldValues
that is of type Reference List
.
In my code, I have an aircraft
CKRecord and several fieldValue
CKRecords that are children of the aircraft.
How do I put all those fieldValue
records into the aircraft
's reference list?
Creating a CKReference
appears to only allow a single record in it:
let reference = CKReference(record: fieldValueRecord, action: .deleteSelf)
But I'm trying to connect many fieldValue
s to a single aircraft
. Any ideas?
Swift 3.1, Xcode 8.3.3
After some trial and error, I finally figured it out. It goes something like this:
I hope that helps someone else.