Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CloudKit by Mustafa Yusuf

CloudKit by Mustafa Yusuf

Swift India Bangalore meet up - Chapter #20

Swift India

December 14, 2019
Tweet

More Decks by Swift India

Other Decks in Programming

Transcript

  1. WHY CLOUDKIT • The free quota • Pagination • Sync

    across all devices • Scales with your user base • No auth required to save personal data • Notifications setup made easy with CKSubscriptions • One of the best in class infrastructure • Uploading images, video, audio or any data, is so easy.
  2. WHY CLOUDKIT • The free quota • Pagination • Sync

    across all devices • Scales with your user base • No auth required to save personal data • Notifications setup made easy with CKSubscriptions • One of the best in class infrastructure • Uploading images, video, audio or any data, is so easy. I got 99 problems, but a dependency ain’t one “ - Jay-Z
  3. HOW TO INTEGRATE IT • Checkbox Approach • Step 1:

    Check the box • Step 2: Save all data to CoreData
  4. HOW TO INTEGRATE IT • Checkbox Approach • Step 1:

    Check the box • Step 2: Save all data to CoreData
  5. HOW TO INTEGRATE IT • Checkbox Approach • Step 1:

    Check the box • Step 2: Save all data to CoreData • Non checkbox approach • Convert your NSManagedObject to a CKRecord • Upload the record(s) using one of the APIs
  6. HOW TO INTEGRATE IT • Checkbox Approach • Step 1:

    Check the box • Step 2: Save all data to CoreData • Non checkbox approach • Convert your NSManagedObject to a CKRecord • Upload the record(s) using one of the APIs
  7. App Container 1 Container 2 Container 3 Private Database Public

    Database Default Zone Default Zone Custom Zones Custom Zone 1 Custom Zone 2 App App Shared Database
  8. THE BEST PRACTICES • Refer WWDC videos • Custom Zones

    >>>>> Default Zones • CKSubscriptions be smart about using them • CKQueryCursor • Make bulk uploads • Listen to the errors, they are extremely handy • Write a wrapper over CloudKit api’s so you can easily replace it • Do not perform nested CloudKit calls • CloudKit should be called minimal times, always store the data offline
  9. THINGS I HATE ABOUT CLOUDKIT • The checkbox option, does

    not allow you to customise • Missing out on android • CloudKit Dashboard gives no analytics