[英]How do I check if user can login to CloudKit?
我可以使用与检查iCloud可用性相同的方式,还是有其他方法来检查CloudKit可用性?
The CKContainer
class has a method called accountStatusWithCompletionHandler:
that's designed for this purpose. CKContainer
类有一个名为accountStatusWithCompletionHandler:
的方法accountStatusWithCompletionHandler:
它是为此目的而设计的。 Call it and check for CKAccountStatusAvailable
. 调用它并检查
CKAccountStatusAvailable
。 You'll still need to listen for NSUbiquityIdentityDidChangeNotification
in case the status changes. 如果状态发生变化,您仍需要监听
NSUbiquityIdentityDidChangeNotification
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.