Concept
Assume user A uses the app and CKFetchRecordsOperation.fetchCurrentUserRecordOperation gets executed, user A's record would be returned.
User is a system defined record type
User A will have access to the following:
Public database
Private database (if authenticated)
Shared database (if authenticated)
User B will have his / her own private and shared database.
Only user can be logged on to one device at a given time, you can't have 2 iCloud accounts signed on the device (In Settings)
So you can only get one record for the current user.
Reference:
https://developer.apple.com/icloud/cloudkit/designing/
Queue to use
For CKFetchRecordsOperation is a subclass of CKDatabaseOperation so you need to use CKDatabase.add
If you use CKContainer.add an exception will be thrown *** Terminating app due to uncaught exception 'CKException', reason: 'CKDatabaseOperations must be submitted to a CKDatabase'
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags: