Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access iCloud as core data for iCloud is deprecated

I am working on an app using core data as I thought I could use sync functionality provided by core data for iCloud for syncing data between iPad and iPhone, now it is deprecated.

I came across CloudKit but it is mainly to create and manage data that can be consumed by community of end users but not just one like chat apps. My app is only for single user so that user can sync their data between their apple eco system devices.

I am new to iOS development so it would be helpful to know which technology will meet my requirements.

In short, can you please suggest what should I use

  1. If have to store data on phone for offline use
  2. Then sync it across devices if user have say iPhone, iPad, and iWatch

P.S. Can you please suggest something that doesn't need the user to be signed into iCloud while saving the data.

like image 979
leaner122 Avatar asked Oct 02 '16 04:10

leaner122


People also ask

Is core data a cloud?

Use Core Data with CloudKit to give users seamless access to the data in your app across all their devices. Core Data with CloudKit combines the benefits of local persistence with cloud backup and distribution. Core Data provides powerful object graph management features for developing an app with structured data.

Do CloudKit apps sync with iCloud users?

This is perhaps the most obvious use for CloudKit: syncing your users' data across their devices. Example: a note taking app where the user can create and read notes on any device associated with their iCloud account. Alternatives: Realm Mobile Platform, Firebase, iCloud KVS, iCloud Documents, custom web app.


2 Answers

The CoreData/iCloud integration is deprecated in iOS 10 / macOS Sierra, and there is no replacement (at least so far).

Way forward so far :

  • Use third party framework such as Ensembles : http://www.ensembles.io
  • Use CloudKit, which can be used for that. See this for a help : https://nickharris.wordpress.com/2016/02/09/cloudkit-core-data-nsoperations-introduction/

Note that CoreData/iCloud integration will still be working for some time in the future. Apps that are using it will not suddenly stop working.

like image 100
AirXygène Avatar answered Sep 28 '22 09:09

AirXygène


Apple just released a new container for Core Data that can sync across devices with iCloud.

Get started here: https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit

Note, this requires iOS 13.

like image 30
netdigger Avatar answered Sep 28 '22 11:09

netdigger