CloudKit and Core sync data between devices

僤鯓⒐⒋嵵緔 提交于 2021-02-07 11:55:40

问题


I created a simple Notes app based on Core data. Now i want add sync between user devices.

And all articles that i read (this, this) said that i should fully get rid of my core data database, and all my code will lost and rework all with ICloud kit?

The is no way to sync data from Core Data to ICloud ? And if i get rid of core data, how my app will work offline ?

And please suggest good simple projects with ICloud sync

P.S. I googled about an hour. Icloud is deprecated so do sync with it is not recommended. I confused. How now i can sync data between devices??


回答1:


Core Data used to have iCloud syncing, but it has been deprecated as of iOS 10. It had several problems, sometimes major.

Apple now has something called CloudKit, which is not the same thing. You can use CloudKit to sync data between devices. But this does not mean that you should drop Core Data. CloudKit only syncs; it is not a replacement for having your app save data on the device, it's only a way to send data to other devices. If you're using CloudKit, you also need to use some other way to store data on the local device.

Also, it's "CloudKit". Not "ICloud Kit". I don't know why, but it's important to get the names right.



来源:https://stackoverflow.com/questions/40865429/cloudkit-and-core-sync-data-between-devices

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