Questions tagged [cloudkit]

CloudKit is a framework for storing and retrieving data on Apple’s iCloud servers. Queries can be run against structured records on the server, and assets provide for large data storage. The public database provides shared storage for web-style apps, and the private database provides storage for user-specific data. CloudKit also provides a user identity so that an iCloud account can be used for sign-in for your app.

CloudKit

CloudKit is a framework for storing and retrieving data on Apple’s iCloud servers. Queries can be run against structured records on the server, and assets provide for large data storage.

The public database provides shared storage for web-style apps, and the private database provides storage for user-specific data.

CloudKit also provides a user identity so that an iCloud account can be used for sign-in for your app.

CloudKit is a transfer mechanism rather than a full sync solution, but it can be used to build custom syncing solutions.

Resources

2317 questions
15
votes
1 answer

"Use default container" doesn't show in iCloud Capabilities

I want set up iCloud sync for CoreData using CloudKit. But when I add iCloud in Capabilities and enable CloudKit checkbox, Use default container don't appear as described in the Doc: Instead, I got this: Maybe I'm missing something?
nomnom
  • 936
  • 10
  • 21
15
votes
1 answer

CKQueryOperation not returning error when device offline

I am trying to use CKQueryOperation, rather then performQuery on my CloudKit database. Both work, but when using a CKQueryOperation I am not getting an error when the device is offline, but I do when using performQuery Here is the bare bones my…
DogCoffee
  • 19,820
  • 10
  • 87
  • 120
15
votes
2 answers

Deleted CloudKit records Reappear

I'm building an iOS application using CloudKit. It should allow a user to add, edit and delete Products in the cloud. The user can organize these in Folders. These folders are just other Record Types in cloudkit. There is no limit to the levels of…
Joris416
  • 4,751
  • 5
  • 32
  • 59
15
votes
1 answer

CloudKit not returning the most recent data

I am having this issue where I save something to the icloud using CloudKit but immediately fetching the results doesn't return the latest data inserted. Example let todoRecord = CKRecord(recordType: "Todos") todoRecord.setValue(todo, forKey:…
Shrikar
  • 840
  • 1
  • 8
  • 30
14
votes
2 answers

UICloudSharingController does not work for Core Data with CloudKit

In the summer, Apple published an informative sample app on sharing objects between iCloud users using Core Data, CloudKit and UICloudSharingController in SwiftUI. However, adding more participants using UICloudSharingController does not appear to…
blu-Fox
  • 401
  • 6
  • 14
14
votes
3 answers

Difference between CloudKit and Key-Value Storage

What is the difference between iCloud's "Key-value storage" and CloudKit? An example scenario would be: if one were to sync a sizable array containing dictionaries, arrays, and other objects. Would the developer want to use CloudKit or Key-value…
Jake Chasan
  • 6,290
  • 9
  • 44
  • 90
14
votes
5 answers

CKQuery from private zone returns only first 100 CKRecords from in CloudKit

Is there any limit to the result of a query to Cloudkit private default zone? I have no clue why I only receive first 100 records with the following query: let p = NSPredicate(format: "(type == 'entered') AND (timestamp >= %@) AND (timestamp <=…
CppChase
  • 901
  • 12
  • 25
14
votes
1 answer

Keep order of NSArray with CloudKit

I'm currently designing a CloudKit based syncing-solution and I wondered what the best way is to keep the order of a list (an array in my case) of cloud items (CKRecord objects) consistent. Apple advises against holding a reference to child objects…
JanApotheker
  • 1,746
  • 1
  • 17
  • 23
14
votes
1 answer

How to query by creationDate in CloudKit?

I want to fetch the last X minutes of public/private entries from CloudKit. I tried something in this effect but failed: let date = NSDate(timeInterval: -60.0 * 120, sinceDate: NSDate()) let predicate = NSPredicate(format: "creationDate >…
Genki
  • 3,055
  • 2
  • 29
  • 42
13
votes
2 answers

Field 'recordName' is not marked queryable - cloudkit dashboard

In Cloudkit Dashboard, I select Record Type, Edit Indexes, then I select Add Basic Index. I see in the dropdown createTime, createdBy, eTag, modTime, modifiedBy, recordID and the record fields. I do not see recordName in the dropdown( Attached…
vrao
  • 545
  • 2
  • 12
  • 33
13
votes
3 answers

CoreData with CloudKit on watchOS not syncing

I have managed to get CoreData with CloudKit working with the new NSPersistentCloudKitContainer on the iOS version of my app and got it to automatically sync while the app is running. However, when I went to set things up on the watchOS app, I…
13
votes
3 answers

CKModifyBadgeOperation is deprecated in iOS 11. Anyone know an alternative approach?

I have searched, and I cannot find an example. I have also tried adapting this code (recommended elsewhere (CloudKit won't reset my badge count to 0): func resetBadgeCounter() { let badgeResetOperation = CKModifyBadgeOperation(badgeValue: 0) …
user1739040
  • 143
  • 5
13
votes
1 answer

How can I inspect app-specific CloudKit data, or access data not accessible in iTunes App?

iOS has a method to expose some of the app data to the end user via iTunes. In addition, an application can store information in CloudKit that is only accessible to the app itself (and presumably not the app author, nor the end user themselves) How…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
13
votes
4 answers

CloudKit: Order query results by creation date

When loading items from CloudKit I would like to order the results by creation date. I believe now it's sorting by the first property of the record. func loadItems() { let predicate = NSPredicate(value: true) let query = CKQuery(recordType:…
colindunn
  • 3,139
  • 10
  • 48
  • 72
12
votes
1 answer

EXC_BAD_INSTRUCTION from com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export

I have an app that runs fine on iOS, but when running with catalyst, it gives me this crash intermittently if I swipe to another virtual Desktop on macOS, and then back, for about 10 times. It mostly happens on a UICollectionViewController This is…
Phuah Yee Keat
  • 1,572
  • 1
  • 17
  • 17