Post

Replies

Boosts

Views

Activity

Reply to Core Data Plus CloudKit - Potential Issue / Question about Binary Data w/ External Storage
I know it's great for those new to Core Data and CloudKit for the system to automatically create record fields in CloudKit, but in this case, I wish I had control over the result to define this piece of binary data as a CKAsset in CloudKit. I will never manipulate the CloudKit data directly, but it would be nice to have consistency in the linking of Core Data binary data to CloudKit fields.
Apr ’23
Reply to CKAssets Download Even When desiredKeys Excludes Them
The issue is fixed. What was the problem? I had another line of code following the records line in which I did not set desiredKeys. Here's the line of code. let (continuingMatchResults, cMatchCursor) = try await database.records(continuingMatchFrom: queryCursor!) Oince I changed it to let (continuingMatchResults, cMatchCursor) = try await database.records(continuingMatchFrom: queryCursor!, desiredKeys: desiredKeys) all was well.
May ’23
Reply to CKQuery with NSPredicate fails when using “CONTAINS” operator
I had the same issue. What I wound up doing is creating a "filter" function which iterated through the CKRecords and removed records which did not match my search criteria. Here's the business part of that code. guard var records = theRecords else {return nil} for (index, record) in records.enumerated().reversed() { if let keyResult = record[keyWord] as? String { let resultString = keyResult.lowercased() if !resultString.contains(searchWord.lowercased()) { records.remove(at: index) } } }
May ’23
Reply to Sharing data with SwiftData
Initialize your ModelConfiguration with your cloudKitContainerIdentifier. init( _ name: String? = nil, schema: Schema? = nil, url: URL, readOnly: Bool = false, cloudKitContainerIdentifier: String? = nil ) See here for details. [https://developer.apple.com/documentation/swiftdata/modelconfiguration/init(_:schema:url:readonly:cloudkitcontaineridentifier:)?changes=_2_10)
Jun ’23