SlideShare a Scribd company logo
Introducing Features
of WatchOS 2
Joe
2015/7/17
Outline
• Architecture of WatchOS 2
• A bunch of new interface elements.
• Complications. (ClockKit)
• Taptic Engine.
• Accessibility
• Open System URL
• Hints of building Watch app
Architecture of
WatchOS 2
Architecture of WatchOS 2
(In order to remove the dependency from
iPhone)
Extensions built specifically for watchOS 2 have
access to the following system frameworks
WatchOS 2 provides ways for communicating with
iOS app or network
• Communicate with network:NSURLSession
• Communicate with iOS app:Watch Connectivity
Watch App communicates with iOS App
and vice versa
(Watch Connectivity)
• Precondition:WCSession.isSupported()
• Communication categories
• Background transfers
• Interactive messaging
Background transfers
• Best when information isn’t needed immediately
• Operating system determines the most suitable
time to send the data
• Content is queued up for transfer
Three ways of communicating
for background transfers
• Application Context:Information waiting in a
transfer queue will get overridden by the latest
data.
• User Info Transfer:Information waiting in a
transfer queue will deliver one by one in FIFO
order.(Like openParentApplication)
• File Transfer:Transfer files
Interactive messaging
• Precondition:iOS and watch App must be in
reachable state.(They must be connected via
Bluetooth) and watch app must be running in
the foreground.
Demo
API for background transfers
• Application Context:
• Sender:updateApplicationContext(_:)
• Receiver:session(_:didReceiveApplicationContext:)
• User Info Transfer:
• Sender:transferUserInfo(_:)
• Receiver:session(_:didReceiveUserInfo:)

• File Transfer:
• Sender:transferFile(_:metadata:)
• Receiver:session(_:didReceiveFile:)
Sender has an instance of WCSession

Receiver is instance which implements 

WCSessionDelegate
API for interactive
messaging
• Sender
• sendMessage(_:replyHandler: errorHandler:)
• sendMessageData(_:replyHandler: errorHandler:)
• Receiver
• session(_:didReceiveMessage:replyHandler:)
• session(_:didReceiveMessageData:replyHandler:)
A bunch of new
interface elements
A bunch of new interface
elements
• WKInterfacePicker (Digital crown)
• Alerts and Action Sheets
• WKInterfaceMovie
• WKInterfaceController
• Playing Short Audio and Video Clips(Behavior like WKInterfaceMovie)
• Recording Short Audio Clips
• Animation
• WKAudioFilePlayer
• Playing Extended Audio Content (It needed to connect a blue tooth headset
now)
Demo
WKInterfacePicker
• A WKInterfacePicker object displays a
sequence of items that the user can navigate
through using the Digital Crown.
• Three types:list、stack、sequence
• Advance:Coordinated images
Alerts and Action Sheets
• Alerts and action sheets offer a standard interface for
displaying messages to the user.When tapped, the buttons
call blocks of code that you provide.
• WKInterfaceController:
presentAlertControllerWithTitle:message:preferredStyle:acti
ons:
• WKAlertControllerStyle:Alert, ActionSheet,
SideBySideButtonAlert
• WKAlertAction:Default, Cancel, Destructive

WKInterfaceMovie
• A WKInterfaceMovie object lets you embed short
audio or video clips directly into your interface.
• setMovieURL(URL: NSURL)
• setVideoGravity(videoGravity: WKVideoGravity)
• setLoops(loops: Bool)
• setPosterImage(posterImage: WKImage?)
Playing Short Audio and
Video Clips
• presentMediaPlayerControllerWithURL(URL:
NSURL, options: [NSObject : AnyObject]?,
completion: (Bool, NSTimeInterval, NSError?) ->
Void)
• dismissMediaPlayerController
Recording Short Audio Clips
• presentAudioRecordingControllerWithOutputUR
L(URL: NSURL, preset:
WKAudioRecordingPreset, maximumDuration:
NSTimeInterval, actionTitle: String?, completion:
(Bool, NSError?) -> Void)
• dismissAudioRecordingController
Animation
• WKInterfaceController
• animateWithDuration:
Playing Extended Audio Content
(WKAudioFilePlayer)
• Precondition: It needed to connect a Bluetooth
Headset with watch.
• WKAudioFilePlayer play WKAudioFilePlayerItem
which contains WKAudioFileAsset(URL, title,
albumTitle, artist, duration)
Complications.
(ClockKit)
Four ways to show
information from your app
• Watch app
• Glance
• Notification
• Complication
Complication
Timeline
( The data that changes by time)
CLKComplicationDataSource
• getSupportedTimeTravelDirectionsForComplication
• getTimelineStartDateForComplication
• getTimelineEndDateForComplication
• getPrivacyBehaviorForComplication
• getCurrentTimelineEntryForComplication
• getTimelineEntriesForComplication
• getNextRequestedUpdateDateWithHandler
• getPlaceholderTemplateForComplication
CLKComplicationTimelineEntry
Different timing (date) corresponding to layout (template)
A bunch of templates
Template
(Layout of complication)
e.g. CLKComplicationTemplateModularLargeStandardBody
headerText
body2Text
body1Text
Text is not type of string.
CLKTextProvider
(It is an abstract class)
• e.g. shows “Thursday, October 22” on
complication by CLKDateTextProvider (truncate
automatically)
• Thur, October 22
• Thur, Oct 22
• Oct 22
• 22
Demo
Taptic Engine
Provide physical feedback
via the Taptic Engine
• WKInterfaceDevice.currentDevice().playHaptic(h
apticType)
• hapticType:Notification, DirectionUp,
DirectionDown, Success, Failure, Retry, Start,
Stop, Click
Accessibility
Apple Watch Accessibility
• setAccessibilityLabel(accessibilityLabel: String?)
• setAccessibilityHint(accessibilityHint: String?)
• setAccessibilityValue(accessibilityValue: String?)
• setIsAccessibilityElement(isAccessibilityElement: Bool)
• setAccessibilityTraits(accessibilityTraits:
UIAccessibilityTraits)
• setAccessibilityImageRegions(accessibilityImageRegions
: [WKAccessibilityImageRegion])
Open System URL
Open System URL
• url:
• tel:
• sms:
• mailto:
• facetime:
• http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino
• http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?
i=156093464&id=156093462&s=143441
• http://www.youtube.com/v/VIDEO_IDENTIFIER
WKExtension.sharedExtension()
.openSystemURL(url)
Hints of building
Watch app
Hints of building Watch app
• UI is stored in Watch app
• One controller per screen of content
• Layout of WatchKit is flow-based layout
• Code updates UI from the extension
• Manages UI elements through outlets
• Uses target-action design pattern
• Profile with Instruments
Reference
• https://developer.apple.com/watch/human-
interface-guidelines/
• http://www.kristinathai.com/watchos-2-how-to-
communicate-between-devices-using-watch-
connectivity/
• watchOS 2 Transition Guide
• https://github.com/joehsieh/watchOS-2-Sampler
Q & A

More Related Content

PDF
Running your dockerized application(s) on AWS Elastic Container Service
PDF
"How about no grep and zabbix?". ELK based alerts and metrics.
PDF
Google App Engine With Java And Groovy
PPTX
How to Develop OpenStack
PPTX
Booting your Microservices Architecture with Spring & Netflix
PDF
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
PDF
Fact-Based Monitoring - PuppetConf 2014
PDF
Basics of the Highly Available Distributed Databases - teowaki - javier ramir...
Running your dockerized application(s) on AWS Elastic Container Service
"How about no grep and zabbix?". ELK based alerts and metrics.
Google App Engine With Java And Groovy
How to Develop OpenStack
Booting your Microservices Architecture with Spring & Netflix
Monitoring Docker at Scale - Docker San Francisco Meetup - August 11, 2015
Fact-Based Monitoring - PuppetConf 2014
Basics of the Highly Available Distributed Databases - teowaki - javier ramir...

What's hot (18)

PDF
How we use Fluentd in Treasure Data
PDF
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
PDF
Strata London 2018: Multi-everything with Apache Pulsar
PPTX
Docker in OpenStack
PDF
Microservices with Netflix OSS and Spring Cloud
PDF
Keystone Federation
ODP
Amazon Aws Presentation Drupal
PDF
Building and running Spring Cloud-based microservices on AWS ECS
PPTX
Monitoring Docker containers - Docker NYC Feb 2015
PDF
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
PDF
Ford's AWS Service Update - March 2020 (Richmond AWS User Group)
PDF
April 2013 HUG: Storm and Hadoop - Convergence of Big-Data and Low-Latency Pr...
PDF
K8s in 2hours
PPTX
Project: OpenStack, #OSATH
PDF
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
PPT
Pax Migration Ocs 23062008
PPT
A Brief Introduce to WSGI
PPTX
Enforcing Application SLA with Congress and Monasca
How we use Fluentd in Treasure Data
2019 Lightning Talk: Discovery, Consul and Inversion of Control for the infr...
Strata London 2018: Multi-everything with Apache Pulsar
Docker in OpenStack
Microservices with Netflix OSS and Spring Cloud
Keystone Federation
Amazon Aws Presentation Drupal
Building and running Spring Cloud-based microservices on AWS ECS
Monitoring Docker containers - Docker NYC Feb 2015
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
Ford's AWS Service Update - March 2020 (Richmond AWS User Group)
April 2013 HUG: Storm and Hadoop - Convergence of Big-Data and Low-Latency Pr...
K8s in 2hours
Project: OpenStack, #OSATH
Central LogFile Storage. ELK stack Elasticsearch, Logstash and Kibana.
Pax Migration Ocs 23062008
A Brief Introduce to WSGI
Enforcing Application SLA with Congress and Monasca
Ad

Similar to WatchOS2 (20)

PPTX
PPTX
Windows 8 Metro apps and the outside world
PDF
Oliot epcis at a glance
PPTX
Basic understanding of websocket and and REST API
PPTX
LowlaDB intro March 2015
PPTX
Meetup on Apache Zookeeper
PDF
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
PPT
PPTX
Re:invent 2016 Container Scheduling, Execution and AWS Integration
PPTX
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
PPTX
Quick overview of Openstack architecture
PPTX
Behind the scenes of Real-Time Notifications
PPTX
Windows Communication Foundation (WCF)
PPTX
What's New in .Net 4.5
PDF
Realtime Web Apps: WebSockets & WebRTC
PPTX
Ceilosca
PDF
Openstack meetup lyon_2017-09-28
PDF
Intro to InfluxDB
PPTX
Websocket vs SSE - Paris.js - 24/06/15
PDF
WebSockets wiith Scala and Play! Framework
Windows 8 Metro apps and the outside world
Oliot epcis at a glance
Basic understanding of websocket and and REST API
LowlaDB intro March 2015
Meetup on Apache Zookeeper
COMMitMDE'18: Eclipse Hawk: model repository querying as a service
Re:invent 2016 Container Scheduling, Execution and AWS Integration
Building the Internet of Things with Thingsquare and Contiki - day 1, part 3
Quick overview of Openstack architecture
Behind the scenes of Real-Time Notifications
Windows Communication Foundation (WCF)
What's New in .Net 4.5
Realtime Web Apps: WebSockets & WebRTC
Ceilosca
Openstack meetup lyon_2017-09-28
Intro to InfluxDB
Websocket vs SSE - Paris.js - 24/06/15
WebSockets wiith Scala and Play! Framework
Ad

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
history of c programming in notes for students .pptx
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
assetexplorer- product-overview - presentation
PDF
Cost to Outsource Software Development in 2025
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Introduction to Artificial Intelligence
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Internet Downloader Manager (IDM) Crack 6.42 Build 41
history of c programming in notes for students .pptx
Which alternative to Crystal Reports is best for small or large businesses.pdf
Computer Software and OS of computer science of grade 11.pptx
Odoo POS Development Services by CandidRoot Solutions
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
top salesforce developer skills in 2025.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
assetexplorer- product-overview - presentation
Cost to Outsource Software Development in 2025
Softaken Excel to vCard Converter Software.pdf
Design an Analysis of Algorithms I-SECS-1021-03
Introduction to Artificial Intelligence
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Why Generative AI is the Future of Content, Code & Creativity?
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free

WatchOS2

  • 2. Outline • Architecture of WatchOS 2 • A bunch of new interface elements. • Complications. (ClockKit) • Taptic Engine. • Accessibility • Open System URL • Hints of building Watch app
  • 4. Architecture of WatchOS 2 (In order to remove the dependency from iPhone)
  • 5. Extensions built specifically for watchOS 2 have access to the following system frameworks
  • 6. WatchOS 2 provides ways for communicating with iOS app or network • Communicate with network:NSURLSession • Communicate with iOS app:Watch Connectivity
  • 7. Watch App communicates with iOS App and vice versa (Watch Connectivity) • Precondition:WCSession.isSupported() • Communication categories • Background transfers • Interactive messaging
  • 8. Background transfers • Best when information isn’t needed immediately • Operating system determines the most suitable time to send the data • Content is queued up for transfer
  • 9. Three ways of communicating for background transfers • Application Context:Information waiting in a transfer queue will get overridden by the latest data. • User Info Transfer:Information waiting in a transfer queue will deliver one by one in FIFO order.(Like openParentApplication) • File Transfer:Transfer files
  • 10. Interactive messaging • Precondition:iOS and watch App must be in reachable state.(They must be connected via Bluetooth) and watch app must be running in the foreground.
  • 11. Demo
  • 12. API for background transfers • Application Context: • Sender:updateApplicationContext(_:) • Receiver:session(_:didReceiveApplicationContext:) • User Info Transfer: • Sender:transferUserInfo(_:) • Receiver:session(_:didReceiveUserInfo:)
 • File Transfer: • Sender:transferFile(_:metadata:) • Receiver:session(_:didReceiveFile:) Sender has an instance of WCSession
 Receiver is instance which implements 
 WCSessionDelegate
  • 13. API for interactive messaging • Sender • sendMessage(_:replyHandler: errorHandler:) • sendMessageData(_:replyHandler: errorHandler:) • Receiver • session(_:didReceiveMessage:replyHandler:) • session(_:didReceiveMessageData:replyHandler:)
  • 14. A bunch of new interface elements
  • 15. A bunch of new interface elements • WKInterfacePicker (Digital crown) • Alerts and Action Sheets • WKInterfaceMovie • WKInterfaceController • Playing Short Audio and Video Clips(Behavior like WKInterfaceMovie) • Recording Short Audio Clips • Animation • WKAudioFilePlayer • Playing Extended Audio Content (It needed to connect a blue tooth headset now)
  • 16. Demo
  • 17. WKInterfacePicker • A WKInterfacePicker object displays a sequence of items that the user can navigate through using the Digital Crown. • Three types:list、stack、sequence • Advance:Coordinated images
  • 18. Alerts and Action Sheets • Alerts and action sheets offer a standard interface for displaying messages to the user.When tapped, the buttons call blocks of code that you provide. • WKInterfaceController: presentAlertControllerWithTitle:message:preferredStyle:acti ons: • WKAlertControllerStyle:Alert, ActionSheet, SideBySideButtonAlert • WKAlertAction:Default, Cancel, Destructive

  • 19. WKInterfaceMovie • A WKInterfaceMovie object lets you embed short audio or video clips directly into your interface. • setMovieURL(URL: NSURL) • setVideoGravity(videoGravity: WKVideoGravity) • setLoops(loops: Bool) • setPosterImage(posterImage: WKImage?)
  • 20. Playing Short Audio and Video Clips • presentMediaPlayerControllerWithURL(URL: NSURL, options: [NSObject : AnyObject]?, completion: (Bool, NSTimeInterval, NSError?) -> Void) • dismissMediaPlayerController
  • 21. Recording Short Audio Clips • presentAudioRecordingControllerWithOutputUR L(URL: NSURL, preset: WKAudioRecordingPreset, maximumDuration: NSTimeInterval, actionTitle: String?, completion: (Bool, NSError?) -> Void) • dismissAudioRecordingController
  • 23. Playing Extended Audio Content (WKAudioFilePlayer) • Precondition: It needed to connect a Bluetooth Headset with watch. • WKAudioFilePlayer play WKAudioFilePlayerItem which contains WKAudioFileAsset(URL, title, albumTitle, artist, duration)
  • 25. Four ways to show information from your app • Watch app • Glance • Notification • Complication
  • 27. Timeline ( The data that changes by time)
  • 28. CLKComplicationDataSource • getSupportedTimeTravelDirectionsForComplication • getTimelineStartDateForComplication • getTimelineEndDateForComplication • getPrivacyBehaviorForComplication • getCurrentTimelineEntryForComplication • getTimelineEntriesForComplication • getNextRequestedUpdateDateWithHandler • getPlaceholderTemplateForComplication
  • 29. CLKComplicationTimelineEntry Different timing (date) corresponding to layout (template)
  • 30. A bunch of templates
  • 31. Template (Layout of complication) e.g. CLKComplicationTemplateModularLargeStandardBody headerText body2Text body1Text Text is not type of string.
  • 32. CLKTextProvider (It is an abstract class) • e.g. shows “Thursday, October 22” on complication by CLKDateTextProvider (truncate automatically) • Thur, October 22 • Thur, Oct 22 • Oct 22 • 22
  • 33. Demo
  • 35. Provide physical feedback via the Taptic Engine • WKInterfaceDevice.currentDevice().playHaptic(h apticType) • hapticType:Notification, DirectionUp, DirectionDown, Success, Failure, Retry, Start, Stop, Click
  • 37. Apple Watch Accessibility • setAccessibilityLabel(accessibilityLabel: String?) • setAccessibilityHint(accessibilityHint: String?) • setAccessibilityValue(accessibilityValue: String?) • setIsAccessibilityElement(isAccessibilityElement: Bool) • setAccessibilityTraits(accessibilityTraits: UIAccessibilityTraits) • setAccessibilityImageRegions(accessibilityImageRegions : [WKAccessibilityImageRegion])
  • 39. Open System URL • url: • tel: • sms: • mailto: • facetime: • http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino • http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum? i=156093464&id=156093462&s=143441 • http://www.youtube.com/v/VIDEO_IDENTIFIER WKExtension.sharedExtension() .openSystemURL(url)
  • 41. Hints of building Watch app • UI is stored in Watch app • One controller per screen of content • Layout of WatchKit is flow-based layout • Code updates UI from the extension • Manages UI elements through outlets • Uses target-action design pattern • Profile with Instruments
  • 43. Q & A