Giter VIP home page Giter VIP logo

Comments (4)

Moriya-Taichi avatar Moriya-Taichi commented on July 30, 2024

https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/creating_a_core_data_model_for_cloudkit#3191035

CoreDataと合わせて使うにはモデルに制約がかかるらしい

  • Uniqueは使えない
  • Undefinedは使えない
  • Relationは全てoptionalでなければならない
  • 逆のRelationをつけるのを推奨
  • 削除時のdenyは使えない
  • 別のConfigurationのエンティティとRelationを持ってはならない

from ormcomparison-ios.

Moriya-Taichi avatar Moriya-Taichi commented on July 30, 2024

https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit

大まかな手順

from ormcomparison-ios.

Moriya-Taichi avatar Moriya-Taichi commented on July 30, 2024

同期の仕組み

  • CloudKitを利用しての同期に際して、コードの追加は必要ない
  • 通常のCoreDataと同じでNSManagedObjectの変更があると勝手にiCloudに流してくれる
  • iCloudからは通知で変更を送っていて、クライアント側では自動的に変換して保存してくれる
  • 通常は1分以内に変更の通知が来るのが期待される

from ormcomparison-ios.

Moriya-Taichi avatar Moriya-Taichi commented on July 30, 2024

セットアップ

  • NSPersistentContainer -> NSPersistentCloudKitContainer
  • Cloudで使いたいエンティティのConfigurationに追加してCloudとLocalで ミラーリングするように設定
    初期化周りはドキュメントのコピペで余裕そう

from ormcomparison-ios.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.