Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I check if user can login to CloudKit?

Can I use the same way I check for iCloud availability or is there some other way of checking for CloudKit availability?

like image 203
ninjaneer Avatar asked Jun 22 '14 00:06

ninjaneer


1 Answers

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.

like image 191
Tom Harrington Avatar answered Oct 22 '22 19:10

Tom Harrington