Sync an iOS application using kernel data in the cloud

I wrote an application with Swift 2 using Core Data to save. I am thinking of adding a feature that is also stored in the cloud. I read the Realm and CloudKit tutorials, but have not seen great examples of using them on top of (or in conjunction with) Core Data.

I want to:

  • allow users to enter their data once and appear on all their devices.
  • allow users to synchronize some of their data with the user of their choice.

Is it possible to save all my basic data logic and just add some server calls during CRUD operations using CloudKit (or some other structure)? For example, I use NSFetchedResultsControllerfor several of my tables, does it make sense to continue using it when using CloudKit?

+5
source share
2 answers

CloudKitand CoreDatado not work automatically without failures, so you will need to write this logic yourself.

iCloud, CoreData, CloudKit CloudKit - , , .

AKA: , , , .

, - , , :

  • Core Data NSManagedObject, .

  • CloudKit Xcode CloudKit Dashboard

  • CloudKit Dashboard , Core Data.

  • ( Xcode) - ( NSManagedObject), , Core Data CKRecord, CKRecord Core Data.

  • Swift, CloudKit Core Data. CloudKit , , , , .. API, ( ), , , , , Core .

CloudKit, ( CloudBrain), , , . , SyncBrain, CloudBrain, iCloud. , iCloud Core Data. , CloudBrain, CKSubscription .

, , , , Core Data, SyncBrain , iCloud .

, iOS 10, , Apple CloudKit Quick Start. CloudKit WWDC .

: CloudKit iCloud Design Guide , . . , CKReference, . , , , ( , , , , - ).

WWDC. - , .

+16

Xcode 11 Core Data . , . NSPersistentCloudKitContainer NSPersistentContainer. CloudKit .

.

PS. , -.

0

Source: https://habr.com/ru/post/1657705/


All Articles