英文:
How to detect when user disables iCloud per app in settings
问题
我目前正在观察.NSUbiquityIdentityDidChange
,我了解它应该在发生与iCloud相关的更改时触发,但如果我在“设置 > Apple ID > iCloud > 使用iCloud的应用程序”中禁用我的应用程序的iCloud,它就不会被触发。
英文:
I'm currently observing .NSUbiquityIdentityDidChange
which I read should be triggered whenever an iCloud related change occurs but it's not being triggered if I disable iCloud for my app in Settings > Apple ID > iCloud > Apps using iCloud
答案1
得分: 1
你可以通过 CloudKid 来实现这一点。
通过注册 CKAccountChanged
通知。
示例
import CloudKit
...
NotificationCenter
.default
.addObserver(forName: .CKAccountChanged,
object: nil,
queue: nil) { notification in
}
英文:
You can accomplish this with CloudKid.
By registering to CKAccountChanged
Notification.
Example
import CloudKit
...
NotificationCenter
.default
.addObserver(forName: .CKAccountChanged,
object: nil,
queue: nil) { notification in
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论