what’s new in cloudkit€¦ · cloudkit js and web services wwdc 2015 what's new in cloudkit...

261
© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. There's a lot we want to share App Frameworks #WWDC16 Session 226 What’s New in CloudKit Paul Seligman CloudKit Engineer Jacob Farkas CloudKit Engineer Vanessa Hong CloudKit Engineer

Upload: others

Post on 14-Jul-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

© 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

There's a lot we want to share

App Frameworks #WWDC16

Session 226

What’s New in CloudKit

Paul Seligman CloudKit EngineerJacob Farkas CloudKit EngineerVanessa Hong CloudKit Engineer

Page 2: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What are we talking about?Table of Contents

Page 3: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What are we talking about?Table of Contents

CloudKit Overview

Page 4: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What are we talking about?Table of Contents

CloudKit OverviewTelemetry

Page 5: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What are we talking about?Table of Contents

CloudKit OverviewTelemetryAPI Improvements

Page 6: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What are we talking about?Table of Contents

CloudKit OverviewTelemetryAPI ImprovementsSharing

Page 7: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is CloudKit?CloudKit Overview

Page 8: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Data everywhere!CloudKit Overview

Page 9: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Data everywhere!CloudKit Overview

iCloud Database

Page 10: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Data everywhere!CloudKit Overview

iCloud DatabaseExtensive use inside Apple

Page 11: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Data everywhere!CloudKit Overview

iCloud DatabaseExtensive use inside AppleUbiquitous

Page 12: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Prior talksCloudKit Overview

Introducing CloudKit WWDC 2014

Page 13: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Introducing CloudKit WWDC 2014

Advanced CloudKit WWDC 2014

CloudKit JS and Web Services WWDC 2015

What's New in CloudKit WWDC 2015

CloudKit Tips and Tricks WWDC 2015

Prior talksCloudKit Overview

Page 14: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Introducing CloudKit WWDC 2014

Advanced CloudKit WWDC 2014

CloudKit JS and Web Services WWDC 2015

What's New in CloudKit WWDC 2015

CloudKit Tips and Tricks WWDC 2015

https://developer.apple.com/cloudkit

Prior talksCloudKit Overview

Page 15: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord Zone

Page 16: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord Zone

Page 17: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord Zone

Page 18: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Overview

ContainerDatabaseRecordRecord Zone

CloudKit Container

Core objects

Page 19: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Overview

ContainerDatabaseRecordRecord Zone

CloudKit Container

Public Database Private Database

Core objects

Page 20: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Overview

CloudKit Container

Public Database Private Database Shared Database

NEW

ContainerDatabaseRecordRecord Zone

Core objects

Page 21: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord Zone

Key ValueTitle String

Body String

CreationDate Date

Folder Reference

Note

Page 22: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objects

Record Zone

CloudKit Overview

ContainerDatabaseRecordRecord Zone

Database

Page 23: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objects

Record Zone

CloudKit Overview

ContainerDatabaseRecordRecord Zone

Database

Record

Page 24: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

ContainerDatabaseRecordRecord Zone

RecordRecord

Database

CloudKit Overview

RecordRecordRecordRecordRecordRecordRecordRecord

Record Zone

RecordRecord

Core objects

Page 25: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objects

Database

CloudKit Overview

Default Zone Custom Zone

ContainerDatabaseRecordRecord Zone

RecordRecord

RecordRecord

Record Record

Record Record

RecordRecordRecordRecord

Page 26: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

ContainerDatabaseRecordRecord Zone

Core objects

Private Database

CloudKit Overview

Public Database Shared Database

Default Zone Default Zone

Custom Zone

Custom Zone

Shared Zone

Shared Zone

Page 27: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord Zone

Page 28: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objectsCloudKit Overview

ContainerDatabaseRecordRecord ZoneShare

NEW

Page 29: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Core objects

Private Database

CloudKit Overview

ContainerDatabaseRecordRecord ZoneShare

NEW

Database

Custom Zone

RecordRecordRecord

RecordRecord

Record

RecordRecord

RecordRecord

Share

Share

Page 30: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Apple usage

CloudKit Container

CloudKit Overview

Public Database Shared DatabasePrivate Database

Page 31: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Apple usage

CloudKit Container

CloudKit Overview

Public Database Shared DatabasePrivate Database

Page 32: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Apple usage

CloudKit Container

CloudKit Overview

Public Database Shared DatabasePrivate Database

Page 33: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Apple usage

CloudKit Container

CloudKit Overview

Public Database Shared DatabasePrivate Database

Page 34: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Is Now Available Everywhere

Page 35: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Is Now Available Everywhere

Page 36: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Is Now Available Everywhere

Page 37: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Is Now Available Everywhere

CloudKit JS Web Services

Page 38: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CloudKit Is Now Available Everywhere NEW

CloudKit JS Web Services

Page 39: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

macOS

Page 40: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

macOS

No Mac App Store requirement

Page 41: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

macOS

No Mac App Store requirement• Add iCloud Capabilities via your provisioning profile

Page 42: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Web

Server to server

Page 43: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Web

Server to server• Acts as admin user

Page 44: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Web

Server to server• Acts as admin user• Uses public/private key pair registered on CloudKit Dashboard

Page 45: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Web

Server to server• Acts as admin user• Uses public/private key pair registered on CloudKit Dashboard• Access to public database

Page 46: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Page 47: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity code

Page 48: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity codeStandalone functionality

Page 49: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity codeStandalone functionality• Can work without phone present (via wifi)

Page 50: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity codeStandalone functionality• Can work without phone present (via wifi)

Full* CloudKit API

*offer does not include CKSubscription

Page 51: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity codeStandalone functionality• Can work without phone present (via wifi)

Full* CloudKit APISimilar code on all Apple platforms

*offer does not include CKSubscription

Page 52: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

watchOS 3

Alternative to watch connectivity codeStandalone functionality• Can work without phone present (via wifi)

Full* CloudKit APISimilar code on all Apple platformsLimited resources

*offer does not include CKSubscription

Page 53: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behavior on the CloudKit DashboardTelemetry

Page 54: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behavior on the CloudKit DashboardTelemetry

NEW

Page 55: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behaviorTelemetry

CloudKit Dashboard

Page 56: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behaviorTelemetry

CloudKit DashboardPublic DB

Page 57: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behaviorTelemetry

CloudKit DashboardPublic DBAggregated Private DBs

Page 58: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behaviorTelemetry

CloudKit DashboardPublic DBAggregated Private DBsHour/day/week/month

Page 59: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Visualize your app's behaviorTelemetry

CloudKit DashboardPublic DBAggregated Private DBsHour/day/week/monthPer Operation type/all Operations

Page 60: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Telemetry

Page 61: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Telemetry

Page 62: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Performance

Page 63: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Correctness

Page 64: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Correctness

Detect client changes with abnormally frequent errors

Page 65: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Correctness

Detect client changes with abnormally frequent errorsError handling is essential

Page 66: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Page 67: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

NEW

Page 68: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record Zones Fetching Multiple Change Sets

Page 69: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record ZonesFetching Multiple Change Sets

Page 70: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Don’t repeat your workLong-Lived Operations

Page 71: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Don’t repeat your workLong-Lived Operations

Operations keep running if your application exits

Page 72: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Don’t repeat your workLong-Lived Operations

Operations keep running if your application exitsCallbacks saved by CloudKit

Page 73: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Don’t repeat your workLong-Lived Operations

Operations keep running if your application exitsCallbacks saved by CloudKitOperation can be replayed later

Page 74: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record ZonesFetching Multiple Change Sets

Page 75: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record Zones Fetching Multiple Change Sets

Page 76: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

QualityOfService Behavior on broken network

userInteractive

userInitiated

utility

background

default

Page 77: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

QualityOfService Behavior on broken network

userInteractive timeout after 60 seconds

userInitiated timeout after 60 seconds

utility

background

default

Page 78: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

QualityOfService Behavior on broken network

userInteractive timeout after 60 seconds

userInitiated timeout after 60 seconds

utility timeout after 7 days

background timeout after 7 days

default timeout after 7 days

Page 79: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

QualityOfService Behavior on broken network

userInteractive timeout after 60 seconds

userInitiated timeout after 60 seconds

utility timeout after 7 days

background timeout after 7 days

default timeout after 7 days

Page 80: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

QualityOfService Behavior on broken network

userInteractive timeout after 60 seconds

userInitiated timeout after 60 seconds

utility timeout after 7 days

background timeout after 7 days

default timeout after 7 days

Page 81: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

Page 82: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

Network inactivity• Use the timeoutIntervalForRequest property on CKOperation• Default value is 60 seconds

Page 83: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

How long do you want to wait?CKOperation Timeouts

Network inactivity• Use the timeoutIntervalForRequest property on CKOperation• Default value is 60 seconds

Start-to-finish timeout• Use the timeoutIntervalForResource property on CKOperation• Default value is 7 days• CKOperation may stay around longer

Page 84: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record Zones Fetching Multiple Change Sets

Page 85: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record ZonesFetching Multiple Change Sets

Page 86: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZonesOperation • Poll for all record zones in a database

Reduce payloads and roundtripsHandling Many Record Zones

Page 87: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZonesOperation • Poll for all record zones in a database

Reduce payloads and roundtripsHandling Many Record Zones

Page 88: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZonesOperation • Poll for all record zones in a database

Reduce payloads and roundtripsHandling Many Record Zones

Page 89: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZonesOperation • Poll for all record zones in a database

Reduce payloads and roundtripsHandling Many Record Zones

CKDatabaseSubscription• Receive a push for each change in a database

CKFetchDatabaseChangesOperation• Fetch ids of record zones with changes

Page 90: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordChangesOperation • Track and fetch record changes on a

per-record-zone basis

Reduce payloads and roundtripsHandling Many Record Zones

CKDatabaseSubscription• Receive a push for each change in a database

CKFetchDatabaseChangesOperation• Fetch ids of record zones with changes

CKFetchRecordZonesOperation • Poll for all record zones in a database

Page 91: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordChangesOperation • Track and fetch record changes on a

per-record-zone basis

Reduce payloads and roundtripsHandling Many Record Zones

CKDatabaseSubscription• Receive a push for each change in a database

CKFetchDatabaseChangesOperation• Fetch ids of record zones with changes

CKFetchRecordZonesOperation • Poll for all record zones in a database

Page 92: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Reduce payloads and roundtripsHandling Many Record Zones

CKDatabaseSubscription• Receive a push for each change in a database

CKFetchDatabaseChangesOperation• Fetch ids of record zones with changes

CKFetchRecordZonesOperation • Poll for all record zones in a database

CKFetchRecordChangesOperation • Track and fetch record changes on a

per-record-zone basis

Page 93: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Reduce payloads and roundtripsHandling Many Record Zones

CKFetchRecordZoneChangesOperation • Fetch record changes over multiple record

zones in a single operation

CKDatabaseSubscription• Receive a push for each change in a database

CKFetchDatabaseChangesOperation• Fetch ids of record zones with changes

CKFetchRecordZonesOperation • Poll for all record zones in a database

CKFetchRecordChangesOperation • Track and fetch record changes on a

per-record-zone basis

Page 94: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKDatabaseSubscriptionHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Database

Page 95: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKDatabaseSubscriptionHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Database

Record

Record

Page 96: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKDatabaseSubscriptionHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Push

Record

Record

Record

Record

Database

Record

Record

Page 97: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKDatabaseSubscriptionHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Push

Record

Record

Record

Record

Database

Record

Record

Page 98: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchDatabaseChangesOperationHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Database

Record

Record

Page 99: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchDatabaseChangesOperationHandling Many Record Zones

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Database

Record

Record

Page 100: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZoneChangesOperationHandling Many Record Zones

Database

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Record

Record

Page 101: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKFetchRecordZoneChangesOperationHandling Many Record Zones

Database

Record Zone

Record Zone

Record Zone

Record Zone

Record

Record

Record

Record

Record

Record

Page 102: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record ZonesFetching Multiple Change Sets

Page 103: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record ZonesFetching Multiple Change Sets

Page 104: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change Sets

public class CKFetchRecordChangesOperation : CKDatabaseOperation {

public var moreComing: Bool { get }

}

Remember this?

Page 105: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change Sets

public class CKFetchRecordChangesOperation : CKDatabaseOperation {

public var moreComing: Bool { get }

}

Remember this?

Client code responsible for fetching next batch

Page 106: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change Sets

public class CKFetchRecordChangesOperation : CKDatabaseOperation {

public var moreComing: Bool { get }

}

Remember this?

Client code responsible for fetching next batchCloudKit idle

Page 107: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsUse this instead

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var fetchAllChanges: Bool

}

Page 108: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsUse this instead

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var fetchAllChanges: Bool

}

CloudKit keeps pipeline full

Page 109: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsUse this instead

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var fetchAllChanges: Bool

}

// fetchAllChanges is true by default

CloudKit keeps pipeline full

Page 110: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsNew callback

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var recordZoneChangeTokensUpdatedBlock: ((CKRecordZoneID, CKServerChangeToken?,

Data?) -> Void)?

}

Page 111: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsNew callback

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var recordZoneChangeTokensUpdatedBlock: ((CKRecordZoneID, CKServerChangeToken?,

Data?) -> Void)?

}

Earlier record changes are safe to commit

Page 112: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Multiple Change SetsNew callback

public class CKFetchRecordZoneChangesOperation : CKDatabaseOperation {

public var recordZoneChangeTokensUpdatedBlock: ((CKRecordZoneID, CKServerChangeToken?,

Data?) -> Void)?

}

Earlier record changes are safe to commitNew server change token can be used on a new CKFetchRecordZoneChangesOperation

Page 113: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

API Improvements

Long Lived OperationsCKOperation TimeoutsHandling Many Record Zones Fetching Multiple Change Sets

Page 114: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

You and I are going to share some recordsSharing UI

Jacob Farkas

Page 115: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

public class CKShare : CKRecord

Page 116: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

What is shared? public class CKShare : CKRecord

Page 117: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

What is shared?Who is it shared with?

public class CKShare : CKRecord

Page 118: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Shared databaseSharing Overview

CloudKit Container

Public Database Shared DatabasePrivate Database

Page 119: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?Sharing Records

Private Database

Page 120: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?Sharing Records

Note

Private Database

Page 121: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?

Note

Sharing Records

Private Database

Page 122: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?

Note

Sharing Records

Private Database

Share public class CKShare : CKRecord {

public init(rootRecord : CKRecord)

}

Page 123: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?

Note

Sharing Records

Private Database

Share

public class CKShare : CKRecord {

public init(rootRecord : CKRecord)

}

Note

Page 124: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What is shared?

Note

Sharing Records

Private Database

Share

public class CKShare : CKRecord {

public init(rootRecord : CKRecord)

}

public class CKRecord {

public var share: CKReference? { get }

}Note

Page 125: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Who is it shared with?

Note

Sharing Records

Private Database

Share

Note

Page 126: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Who is it shared with?Sharing Records

Share

Note

Private Database

Page 127: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Who is it shared with?Sharing Records

Share

Note

Private Database

[email protected]

Page 128: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Who is it shared with?Sharing Records

Share

Note

Private Database

Page 129: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Who is it shared with?Sharing Records

Page 130: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Who is it shared with?Sharing Records

Page 131: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Who is it shared with?Sharing Records

Share

Note

Private Database

Page 132: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Sharing RecordsShare URLs

Page 133: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Sharing Records

https://www.icloud.com/notes/000Y4qow0owP6NOxDzs4qgi8Q

Share URLs

Page 134: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Sharing Records

Family Grocery list”icloud.com/notes

Share URLs

Page 135: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

Owner Other User

Share

Note

Private Database

Accepting a share

Page 136: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

Owner Other User

Share

Note

Private Database

Accepting a share

Page 137: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing Records

Share

Note

Private Database

Owner Other User

Accepting a share

Page 138: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Shared Database

Sharing Records

Share

Note

Private Database

Owner Other User

Accepting a share

Page 139: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Share

Note

Shared Database

Sharing Records

Owner Other User

Page 140: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Note

Private Database

Share

Note

Shared Database

Sharing Records

Share

Note

Private Database

Owner Other User

Page 141: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

DemoSystem Sharing UI

Page 142: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Where does it live?CloudKit Sharing UI NEW

CloudKit

Page 143: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Where does it live?CloudKit Sharing UI NEW

CKRecord

CKShare

CKModifyRecordsOperation

CloudKit

Page 144: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Where does it live?CloudKit Sharing UI NEW

CKRecord

CKShare

CKModifyRecordsOperation

CloudKit

NSSharingService

NSItemProvider

AppKit

UICloudSharingController

UIKit

Page 145: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

UICloudSharingControlleriOS Sharing API

Page 146: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a CloudKit share record

let share = CKShare(rootRecord: rootRecord)

share[CKShareTitleKey] = "Shopping List”

share[CKShareThumbnailImageDataKey] = shoppingListThumbnail

Page 147: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a CloudKit share record

let share = CKShare(rootRecord: rootRecord)

share[CKShareTitleKey] = "Shopping List”

share[CKShareThumbnailImageDataKey] = shoppingListThumbnail

Page 148: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a CloudKit share record

let share = CKShare(rootRecord: rootRecord)

share[CKShareTitleKey] = "Shopping List”

share[CKShareThumbnailImageDataKey] = shoppingListThumbnail

Page 149: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a CloudKit share record

let share = CKShare(rootRecord: rootRecord)

share[CKShareTitleKey] = "Shopping List”

share[CKShareThumbnailImageDataKey] = shoppingListThumbnail

Page 150: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a cloud sharing controller

let sharingController = UICloudSharingController(share: share) {

(controller: UICloudSharingController,

prepareCompletionHandler : (CKShare?, CKContainer?, NSError?) -> Void) in

Page 151: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Create a cloud sharing controller

let sharingController = UICloudSharingController(share: share) {

(controller: UICloudSharingController,

prepareCompletionHandler : (CKShare?, CKContainer?, NSError?) -> Void) in

Page 152: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let sharingController = UICloudSharingController(share: share) {

(controller: UICloudSharingController,

prepareCompletionHandler : (CKShare?, CKContainer?, NSError?) -> Void) in

let modifyOp = CKModifyRecordsOperation(recordsToSave: [rootRecord, share],

recordIDsToDelete: nil)

modifyOp.modifyRecordsCompletionBlock = { (_, _, error) in

prepareCompletionHandler(share, ckContainer, error)

}

self.container.privateCloudDatabase.add(modifyOp)

}

Page 153: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let sharingController = UICloudSharingController(share: share) {

(controller: UICloudSharingController,

prepareCompletionHandler : (CKShare?, CKContainer?, NSError?) -> Void) in

let modifyOp = CKModifyRecordsOperation(recordsToSave: [rootRecord, share],

recordIDsToDelete: nil)

modifyOp.modifyRecordsCompletionBlock = { (_, _, error) in

prepareCompletionHandler(share, ckContainer, error)

}

self.container.privateCloudDatabase.add(modifyOp)

}

Page 154: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let sharingController = UICloudSharingController(share: share) {

(controller: UICloudSharingController,

prepareCompletionHandler : (CKShare?, CKContainer?, NSError?) -> Void) in

let modifyOp = CKModifyRecordsOperation(recordsToSave: [rootRecord, share],

recordIDsToDelete: nil)

modifyOp.modifyRecordsCompletionBlock = { (_, _, error) in

prepareCompletionHandler(share, ckContainer, error)

}

self.container.privateCloudDatabase.add(modifyOp)

}

Page 155: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Set sharing options

sharingController.availablePermissions = [.publicOnly, .readWrite]

sharingController.popoverPresentationController?.sourceView = myShareButton

sharingController.delegate = self

self.present(sharingController, animated:true, completion:nil)

Page 156: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Set sharing options

sharingController.availablePermissions = [.publicOnly, .readWrite]

sharingController.popoverPresentationController?.sourceView = myShareButton

sharingController.delegate = self

self.present(sharingController, animated:true, completion:nil)

Page 157: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Set sharing options

sharingController.availablePermissions = [.publicOnly, .readWrite]

sharingController.popoverPresentationController?.sourceView = myShareButton

sharingController.delegate = self

self.present(sharingController, animated:true, completion:nil)

Page 158: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Set sharing options

sharingController.availablePermissions = [.publicOnly, .readWrite]

sharingController.popoverPresentationController?.sourceView = myShareButton

sharingController.delegate = self

self.present(sharingController, animated:true, completion:nil)

Page 159: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Set sharing options

sharingController.availablePermissions = [.publicOnly, .readWrite]

sharingController.popoverPresentationController?.sourceView = myShareButton

sharingController.delegate = self

self.present(sharingController, animated:true, completion:nil)

Page 160: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit
Page 161: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit
Page 162: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

NSSharingServicemacOS Sharing API

Page 163: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let itemProvider = NSItemProvider()

itemProvider.registerCloudKitShare { (prepareCompletionHandler :

(CKShare?, CKContainer?, NSError?) -> Void) in

// Save the share and root record

}

let sharingService = NSSharingService(named: NSSharingServiceNameCloudSharing)!

sharingService.delegate = self

sharingService.perform(withItems: [itemProvider])

Page 164: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let itemProvider = NSItemProvider()

itemProvider.registerCloudKitShare { (prepareCompletionHandler :

(CKShare?, CKContainer?, NSError?) -> Void) in

// Save the share and root record

}

let sharingService = NSSharingService(named: NSSharingServiceNameCloudSharing)!

sharingService.delegate = self

sharingService.perform(withItems: [itemProvider])

Page 165: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let itemProvider = NSItemProvider()

itemProvider.registerCloudKitShare { (prepareCompletionHandler :

(CKShare?, CKContainer?, NSError?) -> Void) in

// Save the share and root record

}

let sharingService = NSSharingService(named: NSSharingServiceNameCloudSharing)!

sharingService.delegate = self

sharingService.perform(withItems: [itemProvider])

Page 166: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let itemProvider = NSItemProvider()

itemProvider.registerCloudKitShare { (prepareCompletionHandler :

(CKShare?, CKContainer?, NSError?) -> Void) in

// Save the share and root record

}

let sharingService = NSSharingService(named: NSSharingServiceNameCloudSharing)!

sharingService.delegate = self

sharingService.perform(withItems: [itemProvider])

Page 167: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Save the share

let itemProvider = NSItemProvider()

itemProvider.registerCloudKitShare { (prepareCompletionHandler :

(CKShare?, CKContainer?, NSError?) -> Void) in

// Save the share and root record

}

let sharingService = NSSharingService(named: NSSharingServiceNameCloudSharing)!

sharingService.delegate = self

sharingService.perform(withItems: [itemProvider])

Page 168: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Define sharing options

func options(for: NSSharingService, share: NSItemProvider)-> NSCloudKitSharingServiceOptions

{

return [.allowPublic, .allowReadWrite]

}

Page 169: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Define sharing options

func options(for: NSSharingService, share: NSItemProvider)-> NSCloudKitSharingServiceOptions

{

return [.allowPublic, .allowReadWrite]

}

Page 170: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit
Page 171: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit
Page 172: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// User clicked a share

public class NSApplication {

public func application(application: NSApplication,

userAcceptedCloudKitShareWith: CKShareMetadata)

}

Page 173: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// User clicked a share

public class NSApplication {

public func application(application: NSApplication,

userAcceptedCloudKitShareWith: CKShareMetadata)

}

public class UIApplication {

public func application(application: UIApplication,

userAcceptedCloudKitShareWith: CKShareMetadata)

}

Page 174: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

// Add an Info.plist key for CloudKit Sharing

<key>CKSharingSupported</key>

<true/>

Page 175: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Web Sharing UICloudKit JS

Page 176: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit
Page 177: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Sharing In Depth

Vanessa Hong

Page 178: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Deep diveCommon Use Cases

Sharing multiple recordsZones in shared databaseCKShare internalsSharing APIsSpecial notes

Page 179: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

A Note is not a single recordSharing Multiple Records

Note

Page 180: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

A Note consists of many recordsSharing Multiple Records

Note

Asset

Media

Page 181: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

A Note consists of many recordsSharing Multiple Records

Note

Asset

Media Links

Data

Page 182: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

A Note consists of many recordsSharing Multiple Records

Note

Asset

Media Links

Data

Info

Page 183: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Participant should only see a subsetSharing Multiple Records

Note

Asset

Media Links

Data

Info

Page 184: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Tell us what should be sharedSharing Multiple Records

Note

Asset

Media Links

Data

Info

Records have a new propertypublic var parent: CKReference

Page 185: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Parent references define the hierarchy for sharingSharing Multiple Records

Note

Asset

Media Links

Data

Info

Parent Field

Records have a new propertypublic var parent: CKReference

Page 186: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Descendants linked to root record via the parent fieldSharing Multiple Records

Note

Asset

Media Links

Data

Info

Parent Field

Records have a new propertypublic var parent: CKReference

Page 187: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Create Share using CKShare(rootRecord:)Sharing Multiple Records

Note

Asset

Media Links

Data

Info

Share

Parent Field

Records have a new propertypublic var parent: CKReference

Page 188: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Shared DB is only a View into the owner’s private DBSharing Multiple Records

Shared Database

Participant

Private Database

Owner

Page 189: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

After accepting, Participant sees only records with parentSharing Multiple Records

Shared Database

ParticipantOwner

Private Database

Page 190: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

After accepting, Participant sees only records with parentSharing Multiple Records

Shared Database

ParticipantOwner

Private Database

Page 191: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

After accepting, Participant sees only records with parentSharing Multiple Records

Shared Database

ParticipantOwner

Private Database

Page 192: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant cannot add a dangling CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

Page 193: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant cannot add a dangling CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

NEW

Page 194: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant cannot add a dangling CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

NEW

Error

Page 195: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant cannot add a dangling CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

NEW

Error

NEW

Page 196: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant cannot add a dangling CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

Error: No Parent

NEW

Error

NEW

Page 197: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant can add a new parented CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

Page 198: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

readWrite Participant can add a new parented CKRecordSharing Multiple Records

Shared Database

Participant

Private Database

Owner

NEWNEW

Page 199: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two sharesZones in Shared Database

Shared Database

“ShoppingList” Share “Shopping

List” Share

Page 200: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

Shared Database

“ShoppingList” Share “Shopping

List” Share

Record Zone Record Zone

Page 201: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

Shared Database

“ShoppingList” Share “Shopping

List” Share

Record Zone Record Zone

public class CKRecordZoneID {

public var zoneName: String

public var ownerName: String

}

Page 202: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

public class CKRecordZoneID {

public var zoneName: String

public var ownerName: String

}

Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”

Page 203: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

public class CKRecordZoneID {

public var zoneName: String

public var ownerName: String

}

Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”

Page 204: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

public class CKRecordZoneID {

public var zoneName: String

public var ownerName: String

}

Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

Page 205: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, two shares, two zonesZones in Shared Database

public class CKRecordZoneID {

public var zoneName: String

public var ownerName: String

}

Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

Page 206: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, three shares, three zonesZones in Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

“Recipe” Share

zoneName: “OtherZone”ownerName: “_abcxyz”

Shared Database

Page 207: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, three shares, three zonesZones in Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

“Recipe” Share

zoneName: “OtherZone”ownerName: “_abcxyz”

Shared Database

Page 208: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, four shares, three zonesZones in Shared Database

“ShoppingList” Share “Shopping

List” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

“Recipe” Share

zoneName: “OtherZone”ownerName: “_abcxyz” “Great

Hiking Trails”

Share

Shared Database

Page 209: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Two owners, four shares, three zonesZones in Shared Database

“ShoppingList” Share

zoneName: “Notes” zoneName: “Notes”ownerName: “_abcxyz” ownerName: “_1234567”

“Recipe” Share

zoneName: “OtherZone”ownerName: “_abcxyz”

Shared Database

“ShoppingList” Share

“Great Hiking Trails”

Share

Page 210: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Prerequisite—Owner has existing Record(s) to shareCKShare

“Shopping List”

Page 211: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Prerequisite—Owner has existing Record(s) to shareCKShare

“Shopping List”

What to Share

Page 212: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Prerequisite—Owner has existing Record(s) to shareCKShare

“Shopping List”

What to Share

Share

How to Share

Page 213: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Is a CKRecord containing access controls for shared dataCKShare

Every CKShare has additional properties beyond a basic CKRecord

Page 214: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Is a CKRecord containing access controls for shared dataCKShare

Every CKShare has additional properties beyond a basic CKRecord

public class CKShare : CKRecord {

public var participants: [CKShareParticipant]

}

Share

public class CKShareParticipantParticipantParticipantParticipantParticipant

Page 215: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Owner sets up the ShareCKShare Lifecycle—Invite-Only

Page 216: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—Invite-Only

1. Create a Share

Page 217: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—Invite-Only

1. Create a Share2. publicPermission=none

publicPermission: none

Page 218: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—Invite-Only

Participant #1

acceptanceStatus: invited

permission: readWrite

Participant #2

acceptanceStatus: invited

permission: readOnly

1. Create a Share2. publicPermission=none3. Add Participant

1. acceptanceStatus=invited2. Owner determines each

participant’s permission

publicPermission: noneparticipants:

Page 219: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—Invite-Only

Participant #1

acceptanceStatus: invited

permission: readWrite

Participant #2

acceptanceStatus: invited

permission: readOnly

1. Create a Share2. publicPermission=none3. Add Participant

1. acceptanceStatus=invited2. Owner determines each

participant’s permission

4. Save the Share

publicPermission: noneparticipants:

Page 220: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—Invite-Only

Participant #1

acceptanceStatus: invited

permission: readWrite

Participant #2

acceptanceStatus: invited

permission: readOnly

1. Create a Share2. publicPermission=none3. Add Participant

1. acceptanceStatus=invited2. Owner determines each

participant’s permission

4. Save the Share5. Owner gets URL

publicPermission: none

“Shopping List”icloud.com/notes

url:

participants:

Page 221: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Participant joins the ShareCKShare Lifecycle—Invite-Only

Share

publicPermission: none

“Shopping List”icloud.com/notes

url:

participants:

Participant #1

acceptanceStatus: invited

permission: readWrite

Participant #2

acceptanceStatus: invited

permission: readOnly

Page 222: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Participant joins the ShareCKShare Lifecycle—Invite-Only

Share 1. Participants accept via URLacceptanceStatus=accepted

publicPermission: none

“Shopping List”icloud.com/notes

url:

participants:

Participant #1

acceptanceStatus: invited

permission: readWrite

Participant #2

acceptanceStatus: invited

permission: readOnly

Participant #1

acceptanceStatus: accepted

permission: readWrite

Participant #2

acceptanceStatus: accepted

permission: readOnly

Page 223: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Owner sets up the ShareCKShare Lifecycle—readOnly or readWrite

Page 224: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—readOnly or readWrite

1. Create a Share

Page 225: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—readOnly or readWrite

1. Create a Share2. publicPermission=readOnly

or readWritepublicPermission: readOnly or readWrite

Page 226: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—readOnly or readWrite

1. Create a Share2. publicPermission=readOnly

or readWrite3. Save the SharepublicPermission: readOnly or readWrite

Page 227: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Share

Owner sets up the ShareCKShare Lifecycle—readOnly or readWrite

1. Create a Share2. publicPermission=readOnly

or readWrite3. Save the Share4. Owner gets URL

“Shopping List”icloud.com/notes

url:

publicPermission: readOnly or readWrite

Page 228: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Participant joins the ShareCKShare Lifecycle—readOnly or readWrite

Share

Participant #1

acceptanceStatus: accepted

1. Anyone can join via URL. acceptanceStatus=accepted, permission is the same as the publicPermission

“Shopping List”icloud.com/notes

url:

publicPermission: readOnly or readWriteparticipants:

Page 229: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Lifecycle—end the share for a participantCKShare

Private DB

Owner

Shared DB

ParticipantParticipant leaves the Share by deleting the Share from their Shared DB

Page 230: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Lifecycle—end the share for a participantCKShare

Private DB

Owner

Shared DB

ParticipantParticipant leaves the Share by deleting the Share from their Shared DB

Page 231: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Lifecycle—end the share for a participantCKShare

Private DB

Owner

Shared DB

ParticipantParticipant leaves the Share by deleting the Share from their Shared DB

Owner can always remove any Participant

Page 232: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Lifecycle—End the share for everyoneCKShare

“Shopping List” Share

Owner deletes the Share from his private DB

Page 233: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Lifecycle—End the share for everyoneCKShare

“Shopping List”

Owner deletes the Share from his private DB

Page 234: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKUserIdentityCKShareParticipant

Participant public class CKShareParticipant {

public var userIdentity: CKUserIdentity

}

public class CKUserIdentity {

public var lookupInfo: CKUserIdentityLookupInfo

public var nameComponents: PersonNameComponents

}

Page 235: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKUserIdentityCKShareParticipant

Participant public class CKShareParticipant {

public var userIdentity: CKUserIdentity

}

public class CKUserIdentity {

public var lookupInfo: CKUserIdentityLookupInfo

public var nameComponents: PersonNameComponents

}

Page 236: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKUserIdentityCKShareParticipant

Participant public class CKShareParticipant {

public var userIdentity: CKUserIdentity

}

public class CKUserIdentity {

public var lookupInfo: CKUserIdentityLookupInfo

public var nameComponents: PersonNameComponents

}

Page 237: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

CKUserIdentityCKShareParticipant

Participant public class CKShareParticipant {

public var userIdentity: CKUserIdentity

}

public class CKUserIdentity {

public var lookupInfo: CKUserIdentityLookupInfo

public var nameComponents: PersonNameComponents

}

Page 238: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Mapped to iCloud accountsCKShareParticipant

Page 239: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Mapped to iCloud accounts

Participant #3

userIdentity.lookupInfo: <email>

Participant #4

userIdentity.lookupInfo: <phone>

Participant #2

userIdentity.lookupInfo: <phone>

Participant #1

userIdentity.lookupInfo: <email>

CKShareParticipant

Page 240: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Mapped to iCloud accounts

Participant #3

userIdentity.lookupInfo: <email>

Participant #4

userIdentity.lookupInfo: <phone>

Participant #2

userIdentity.lookupInfo: <phone>

Participant #1

userIdentity.lookupInfo: <email>

CKShareParticipant

Page 241: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Mapped to iCloud accounts

Participant #3

userIdentity.lookupInfo: <email>

Participant #4

userIdentity.lookupInfo: <phone>

Participant #2

userIdentity.lookupInfo: <phone>

Participant #1

userIdentity.lookupInfo: <email>

CKShareParticipant

No iCloud account

Verification flow to prove email ownership

No iCloud account

Verification flow to prove phone ownership

Page 242: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

If you want to create your own Custom UISharing APIs

On behalf of the owner• Setting up the Share

On behalf of the participant• Accept the Share

watchOS and tvOS• Shared records available, but no System UI

Page 243: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Adding participantsOwner Sets Up the Share

Page 244: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Adding participantsOwner Sets Up the Share

CKFetchShareParticipantsOperation• Can look up via

- Email- Phone- CloudKit User Record ID

Page 245: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Adding participantsOwner Sets Up the Share

CKFetchShareParticipantsOperation• Can look up via

- Email- Phone- CloudKit User Record ID

• Returns CKShareParticipants

Page 246: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Adding participantsOwner Sets Up the Share

CKFetchShareParticipantsOperation• Can look up via

- Email- Phone- CloudKit User Record ID

• Returns CKShareParticipants

Pass CKShareParticipants to addParticipant

Page 247: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Adding participantsOwner Sets Up the Share

CKFetchShareParticipantsOperation• Can look up via

- Email- Phone- CloudKit User Record ID

• Returns CKShareParticipants

Pass CKShareParticipants to addParticipantCall CKModifyRecordsOperation to save the share

Page 248: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Fetch Share Metadata, then Accept the ShareParticipant Accepts a Share

CKFetchShareMetadataOperation• Converting a URL to CKShareMetadataPass CKShareMetadata to CKAcceptSharesOperation

Page 249: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

LimitationsParticipant Accepts a Share

No nameComponents, for privacy reasonspublic class CKUserIdentity {

public var nameComponents: PersonNameComponents // empty

}

Verification flow only available via System UI:CKErrorParticipantMayNeedVerification

shareParticipant.userIdentity.lookupInfo.hasiCloudAccount

Page 250: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Invitees on older platformsSharing

Owner can invite anybody• Invitee may not have installed the latest operating system• Invitee may not have an Apple product

Page 251: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

1280 x 800

Page 252: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

1280 x 800

Page 253: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

1280 x 800

Page 254: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

1280 x 800

Page 255: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

1280 x 800

Page 256: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Get your container ready for SharingSharing

CKRecordTypeShare• Behaves like any other Record Type in CloudKit• Can create custom fields• Can run queries

To trigger its creation• Share a record in a custom zone in any private database in the development environment• Deploy schema to productionNow, users in production can create Shares

Page 257: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

What’s new is now oldSummary

CloudKit is available on all platformsTelemetry available on CloudKit DashboardAPI ImprovementsNew Feature—Sharing• Sharing System UI• Sharing APIs, Objects, and Lifecycle• Configure your fallback URL!

Page 258: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

More Information

https://developer.apple.com/wwdc16/226

Page 259: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Related Sessions

CloudKit Best Practices Pacific Heights Friday 9:00AM

Page 260: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit

Labs

CloudKit and iCloud Lab Frameworks Lab D Thursday 4:00PM

CloudKit and iCloud Lab Frameworks Lab B Friday 12:00PM

Page 261: What’s New in CloudKit€¦ · CloudKit JS and Web Services WWDC 2015 What's New in CloudKit WWDC 2015 CloudKit Tips and Tricks WWDC 2015 Prior talks CloudKit Overview. ... CloudKit