问题
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