|
See: https://developer.apple.com/library/content/documentation/DataManagement/Conceptual/CloudKitQuickStart/EnablingiCloudandConfiguringCloudKit/EnablingiCloudandConfiguringCloudKit.html#//apple_ref/doc/uid/TP40014987-CH2-SW1 |
|
|
|
01. Add Containers to an App |
|
|
|
Select an existing container ID used by another app or create a new one. |
|
|
|
To add a container to an app |
|
|
|
A. In the Capabilities pane under the iCloud settings, select “Specify custom containers.” |
|
When you previously selected the CloudKit service, Xcode created a default container ID for your |
|
app that matches the bundle ID. A checkmark appears next to the default container ID. |
|
|
|
B. If necessary, click the Refresh button below the Containers table to download containers from |
|
your developer account that are used by other apps. |
|
|
|
C. In the row of the container ID you want to add, select the checkbox. |
|
Xcode updates the list of container IDs in the entitlements file. |
|
|
|
|
|
02. Create Custom Containers |
|
|
|
Alternatively, create a custom container shared by multiple apps. |
|
|
|
To create a custom container |
|
|
|
A. If "Use default container” is selected, select “Specify custom containers.” |
|
|
|
B. Click the Add button (+) at the bottom of the table. |
|
|
|
C. In the dialog that appears, enter an identifier for the container you want to add. |
|
|
|
Warning: You can’t delete a container ID, so choose the container ID carefully. |
|
A container ID begins with iCloud. followed by a string in reverse DNS notation. |
|
|
|
D. Click OK. |
|
|
|
Xcode adds the new container ID to the Xcode project entitlements file and to your developer account |
|
|
|
If you want to share the new container ID with another app, add the container to the app, as described |
|
in Add Containers to an App. |
|
|
|
03. Verify Your Steps |
|
|
|
You can view all the container IDs for your team in the Capabilities pane in Xcode or |
|
your developer account. In your developer account, you can also add containers and edit the |
|
name of containers. |
|
|
|
To view container IDs in your developer account |
|
|
|
Go to Certificates, Identifiers & Profiles and for Mac apps, choose OS X from the |
|
pop-up menu on the left. |
|
|
|
Under Identifiers, select iCloud Containers. |
|
|
|
Optionally, in the upper right corner, click the search button and enter text in the search field. |
|
|
|
|
|
|
|
|