问题
Which CloudKit services are not available if user not turns on iCloud Drive?
Is it any way to turn on iCloud Drive from app?
I guess downloading records from public container should work regardless iCloud Drive, writing container only if it is enabled?!
回答1:
CloudKit is linked to the iCloud account. If the user is login in into iCloud, but does not have iCloudDrive enabled, then there are no limitations to CloudKit.
If the user is not logged in into iCloud, then he can only access public data. You could set this on any recordType from the CloudKit dashboard.
There is no way to change the login from within your app. You can only login from the settings app. There is also no way to enable iCloud Drive from your app. For that you also need to go to the settings app
回答2:
Here is where Apple implies iCloud Drive is required for CloudKit:
Improve the user’s experience by verifying that the user is signed in to their iCloud account before saving records. If the user is not signed in, present an alert instructing the user how to enter their iCloud credentials and enable iCloud Drive. Insert your code that saves records in the else clause below.
https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/CloudKitQuickStart/CreatingaSchemabySavingRecords/CreatingaSchemabySavingRecords.html#//apple_ref/doc/uid/TP40014987-CH3-SW8
来源:https://stackoverflow.com/questions/34067778/which-restriction-an-app-with-cloudkit-has-if-user-does-not-turn-on-icloud-drive