Can I use the same way I check for iCloud availability or is there some other way of checking for CloudKit availability?
Asked
Active
Viewed 2,081 times
1 Answers
12
The CKContainer class has a method called accountStatusWithCompletionHandler: that's designed for this purpose. Call it and check for CKAccountStatusAvailable. You'll still need to listen for NSUbiquityIdentityDidChangeNotification in case the status changes.
Tom Harrington
- 69,312
- 10
- 146
- 170
-
What if user if offline, but logged in to iCloud. Will it work and return CKAccountStatusAvailable? – János Dec 04 '15 at 14:59
-
It should. Offline, the phone still knows about the account. – Tom Harrington Dec 04 '15 at 17:50