I have been playing around with CloudKit and I was under the impression that the user needed to be logged-in into iCloud in order to use CloudKit, but I don't think it's true.
I'm testing an app that successfully communicates with the private database in CloudKit, I can read and write records to it. To my surprise I logged-off from my iCloud account and from the Sandbox Account and I can still read and write records from CloudKit which was unexpected, I was thinking that after logging off I wouldn't be able to communicate with CloudKit, in fact, I deleted the app from my phone, recompiled in Xcode and the app can still communicate with CloudKit.
Is this normal behavior, does CloudKit works without the user being logged into iCloud?
Thanks
I'm testing an app that successfully communicates with the private database in CloudKit, I can read and write records to it. To my surprise I logged-off from my iCloud account and from the Sandbox Account and I can still read and write records from CloudKit which was unexpected, I was thinking that after logging off I wouldn't be able to communicate with CloudKit, in fact, I deleted the app from my phone, recompiled in Xcode and the app can still communicate with CloudKit.
Is this normal behavior, does CloudKit works without the user being logged into iCloud?
Thanks
Here is the code I'm using...
Connection to the Private Database
Reading records
Writing Records
What I ultimately need to know is whether I need to check if the user is logged in or not when accessing the database to avoid redundant code/checks.
Thanks
Connection to the Private Database
Code Block let privateDatabase = CKContainer.default().database(with: .private)
Reading records
Code Block `privateDatabase.perform(query, inZoneWith:nil){( results , error) in ... }
Writing Records
Code Block privateDatabase.save(ckRecord){ (record, error) in ...}
What I ultimately need to know is whether I need to check if the user is logged in or not when accessing the database to avoid redundant code/checks.
Thanks