Can I transfer CloudKit data to a new Container?

烂漫一生 提交于 2019-12-13 15:41:39

问题


I'm making a CloudKit app, and I'm faced with the choice of storing my data in the default container, accessible only by that app, or a custom container that can share data. For now I only need that app to access the data, so I would probably put my data in the default container. However, if eventually I want to access this data from a different app, can I transfer my user data to a custom, shareable container?


回答1:


No need to transfer your data: the default container can be used from your other apps.

You can specify the name of your original app's default container in your new app's CloudKit capabilities and then use it to initialise a CKContainer to access it.

See this SO answer and 'Share Containers Between Apps' and 'Enable iCloud and Select CloudKit' in this Apple Doc for details.



来源:https://stackoverflow.com/questions/38486708/can-i-transfer-cloudkit-data-to-a-new-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!