SlideShare une entreprise Scribd logo
1  sur  39
Apple Watch and Apple WatchKit
• A look at Apple Watch
• WatchKit
• Structure and life cycle
• WatchKit Framework
• Creating watch app
Content
A look at Apple Watch
Size & Screens
Sensors
• Gyroscope
• Measures angular velocity
• Determine orientation of device
• Accelerometer
• Measures non-gravitational acceleration
• Type of activity
• Intensity of activity
• Heart Rate monitor
• Measure heart response to exercise
• Physical training apps
Connectivity
• Bluetooth Connectivity
• Connectivity with phone
• Connectivity with headphone or headsets.
• Wireless Charging
Input Buttons and Gestures
• Buttons
• Digital crown
• Conversation button
• Gestures
• Vertical scrolling
• Horizontal swipe
• Left edge swipe
• Force touch
• Tap
Communication
• Glance
• Notification
• Short-look interface
• Long-look interface
• Watch Interface
• Hierarchical navigation interface
• Page-base navigation interface
WatchKit
WatchKit
The apple watch requires an iPhone paired with it to run the apps
without an iPhone the watch apps will not work. For creating watch app
we need two separate bundles
• WatchKit app
The watch kit app contains only storyboard and resource files
associated with our apps UI.
• WatchKit extension
The WatchKit extension contains the code for managing the WatchKit
app’s UI and for responding user interactions.
Since both of these bundle are packed in side the ios app so during the
installation of the app the system prompts the user to install the
watchkit app when a paired watch is present
Structure and life cycle
App Structure
Communication between Watchkit App
VS Watchkit extension
Watch app Launching
Watch app life cycle
WatchKit Framework
A look at WatchKit framework
The whole apple watch is managed by the
few classes the most used are as
• WKinterfaceController
• WKUserNotificationInterfaceController
• WKInterfaceDevice
• WKInterfaceObject
A look at WatchKit framework
WKInterfaceController in WatchKit is the same as
UIViewController in UIKit.
WKInterfaceController is a lot more restricted and has a
different life cycle. There are different methods to work with
as following.
UIViewController WKInterfaceController
likeviewDidLoad Init
loadView awakeWithContext
ViewWillAppear WillActivate
ViewWillDisappear didDeactivate
A look at WatchKit framework
• WKUserNotificationInterfaceController
Its a WKInterfaceController subclass that is used to display
custom notification interfaces.
• WKInterfaceDevice
This class contains basic information related to the iWatch.
This includes screen bounds, scale and current locale. You
can also use it to manage your images cache. WatchKit
allows you to store up to 20 MB of cached images on the
iWatch.
A look at WatchKit framework
• WKInterfaceObject
This is the base class for all UI controls supported by
WatchKit. As we cannot use UI views from UIKit. All we can
do is use the ones that WatchKit provides.
• WKInterfaceButton
• WKInterfaceDate
• WKInterfaceGroup
• WKInterfaceImage
• WKInterfaceLabel
• And more
A look at WatchKit framework
• Watchkit layout
WatchKit does not use Auto layout to position it’s element.
This is because it might have been too complex for the
slow iWatch. Instead we have a layout system that
positions elements relative to each other in a horizontal or
vertical order.
A look at WatchKit framework
• Glances
The apple watch is designed so that user can have a quick
access to the information from the app on iPhone. This is
achieved by “Glance Interface controller” which is non-
scrollable view with the precise info and user can launch
the app by tapping in it or can close it.
Apple prohibits using any interfaceObject on this screen
because “Glances do not support interactivity—tapping
on a glance automatically launches your WatchKit app”
A look at WatchKit framework
• Static notification interfaces
It is a simplified version of notification appearance,
it contains static image and text. Only notification
text can be changed.
• Dynamic notification interfaces
It allow you to specify a custom controller to
display notification. Dynamic notification are not
interactive and should be designed to display the
info, tapping on it will launch the application
Sharing data with containing iOS
app
This can be done with by different methods which are as
following
• By NSUserDefault
we can create and init the object of user default by initiating
with initwithSuiteName
• By NSFilemanager
we can create a shared container using group id
[[NSFileManager defaultManager]
containerURLForSecurityApplicationGroupIdentifier:@"gr
oup.com.swenggco.TodayExtensionApp"];
Sharing data with containing iOS
app
• By openParentApplication:reply: method
we can communicate directly with containing app by calling
the openParentApplication:reply: method, which iOS
launches or wakes the containing iOS app in the
background and calls
the application:handleWatchKitExtensionRequest:reply: m
ethod of its app delegate. The app delegate performs the
request using the provided dictionary and then returns a
reply to the WatchKit extension.
Creating watch app
• First we need to add watch app target to the iOS project.
To do this, select your project in the explorer and click the +
button at the bottom of the project.
Creating watch app
Select WatchKit App and hit Next
Select Finish when you are done
Now we have two new folders in
project directory
Setup an app group
App Groups are the scheme iOS uses to allow different
apps to share data. If the apps have the right entitlements
and proper provisioning, they can access a shared
directory outside of their normal iOS sandbox.
To create groups we have to turn on “app groups”
entitlement in Xcode for app and also for the extension.
When you flip that switch, Xcode will talk to the developer
center to configure your app ID for app groups. Then you
can select a group or create a new one.
Setup an app group
Setup an app group
Share a classes or framework
• We can also use a class a framework in watch extension
from the main project by selecting extension from “Target
membership” in “file inspector”.
Share a classes or framework
Now every thing is setup developing the watch
app. Add more WKinterfaceController start
building your watch app.
References
https://developer.apple.com/library/prerelease/ios/documen
tation/General/Conceptual/WatchKitProgrammingGuide/
https://developer.apple.com/library/prerelease/ios/documen
tation/UserExperience/Conceptual/WatchHumanInterfaceG
uidelines/index.html#//apple_ref/doc/uid/TP40014992-CH3-
SW1
http://swiftiostutorials.com/watchkit-tutorial/
http://stablekernel.com/blog/watchkit-sharing-app-data/
Need help launching your great Apple Watch App.
Swenggco Software
Email: sales@swenggco-software.com
Web: www.swenggco-software.com
Thanks

Contenu connexe

Tendances

Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
Nicholas Jansma
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
瑋琮 林
 

Tendances (18)

Google Android
Google AndroidGoogle Android
Google Android
 
Android App development I
Android App development IAndroid App development I
Android App development I
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
WWDC 15 - Apple's Developer Event @ 8-12 June, 2015
 
Development Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDKDevelopment Playbook Application With Adobe AIR 2.5 and QNX SDK
Development Playbook Application With Adobe AIR 2.5 and QNX SDK
 
Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5Google Glass, the GDK, and HTML5
Google Glass, the GDK, and HTML5
 
Workshop on Sencha Touch - Part 2 - First application in sencha touch
Workshop on Sencha Touch - Part 2 - First application in sencha touchWorkshop on Sencha Touch - Part 2 - First application in sencha touch
Workshop on Sencha Touch - Part 2 - First application in sencha touch
 
End-to-end Mobile App Development (with iOS and Azure Mobile Services)
End-to-end Mobile App Development (with iOS and Azure Mobile Services)End-to-end Mobile App Development (with iOS and Azure Mobile Services)
End-to-end Mobile App Development (with iOS and Azure Mobile Services)
 
Android Application Development Using Java
Android Application Development Using JavaAndroid Application Development Using Java
Android Application Development Using Java
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Introduction to State Restoration in Flutter
Introduction to State Restoration in FlutterIntroduction to State Restoration in Flutter
Introduction to State Restoration in Flutter
 
Android terminologies
Android terminologiesAndroid terminologies
Android terminologies
 
Activity
ActivityActivity
Activity
 
Anatomy of android application
Anatomy of android applicationAnatomy of android application
Anatomy of android application
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011
 
Building mobile back ends with windows azure mobile services
Building mobile back ends with windows azure mobile servicesBuilding mobile back ends with windows azure mobile services
Building mobile back ends with windows azure mobile services
 
Android Life Cycle
Android Life CycleAndroid Life Cycle
Android Life Cycle
 
Android life cycle
Android life cycleAndroid life cycle
Android life cycle
 

En vedette (7)

Apple Watch and WatchKit
Apple Watch and WatchKitApple Watch and WatchKit
Apple Watch and WatchKit
 
Apple Watch, Android Wear, Microsoft Band, and other wrist-based sensor platf...
Apple Watch, Android Wear, Microsoft Band, and other wrist-based sensor platf...Apple Watch, Android Wear, Microsoft Band, and other wrist-based sensor platf...
Apple Watch, Android Wear, Microsoft Band, and other wrist-based sensor platf...
 
Samsung Galaxy Gear
Samsung Galaxy GearSamsung Galaxy Gear
Samsung Galaxy Gear
 
Apple Watch
Apple WatchApple Watch
Apple Watch
 
Smart watch
Smart watchSmart watch
Smart watch
 
Smartwatch presentation
Smartwatch presentationSmartwatch presentation
Smartwatch presentation
 
Apple presentation final ppt
Apple presentation final pptApple presentation final ppt
Apple presentation final ppt
 

Similaire à Apple Watch and WatchKit - A Technical Overview

Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
Vu Tran Lam
 
Session 16 - Designing universal interface which used for iPad and iPhone
Session 16  -  Designing universal interface which used for iPad and iPhoneSession 16  -  Designing universal interface which used for iPad and iPhone
Session 16 - Designing universal interface which used for iPad and iPhone
Vu Tran Lam
 

Similaire à Apple Watch and WatchKit - A Technical Overview (20)

Create your First Watchkit App
Create your First Watchkit AppCreate your First Watchkit App
Create your First Watchkit App
 
watch_kit_v_1.0
watch_kit_v_1.0watch_kit_v_1.0
watch_kit_v_1.0
 
WatchOS Architecture
WatchOS ArchitectureWatchOS Architecture
WatchOS Architecture
 
I WATCH DOCUMENTATION
I WATCH DOCUMENTATIONI WATCH DOCUMENTATION
I WATCH DOCUMENTATION
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Apple Watch and Xamarin (NoVA Mobile C# Dev Group 4/8/15)
Apple Watch and Xamarin (NoVA Mobile C# Dev Group 4/8/15)Apple Watch and Xamarin (NoVA Mobile C# Dev Group 4/8/15)
Apple Watch and Xamarin (NoVA Mobile C# Dev Group 4/8/15)
 
Revue des annonces WWDC2015
Revue des annonces WWDC2015Revue des annonces WWDC2015
Revue des annonces WWDC2015
 
AppleWatch_Presentation
AppleWatch_PresentationAppleWatch_Presentation
AppleWatch_Presentation
 
Getting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple WatchGetting Started with Developing for the Apple Watch
Getting Started with Developing for the Apple Watch
 
Workflow automation i phone application for a construction company
Workflow automation i phone application for a construction companyWorkflow automation i phone application for a construction company
Workflow automation i phone application for a construction company
 
What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?What’s New in iOS 8 SDK ?
What’s New in iOS 8 SDK ?
 
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 applicationSession 8 - Xcode 5 and interface builder for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
 
Getting Started With Developing For Apple Watch
Getting Started With Developing For Apple WatchGetting Started With Developing For Apple Watch
Getting Started With Developing For Apple Watch
 
Session 16 - Designing universal interface which used for iPad and iPhone
Session 16  -  Designing universal interface which used for iPad and iPhoneSession 16  -  Designing universal interface which used for iPad and iPhone
Session 16 - Designing universal interface which used for iPad and iPhone
 
Iot physical servers and cloud offerings
Iot physical servers and cloud offeringsIot physical servers and cloud offerings
Iot physical servers and cloud offerings
 
Basics 4
Basics   4Basics   4
Basics 4
 
Apple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A MarketerApple Watch: Everything You Need To Know As A Marketer
Apple Watch: Everything You Need To Know As A Marketer
 
Ui 5
Ui   5Ui   5
Ui 5
 
Your 1st Apple watch Application
Your 1st Apple watch ApplicationYour 1st Apple watch Application
Your 1st Apple watch Application
 

Dernier

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Cara Menggugurkan Kandungan 087776558899
 

Dernier (8)

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
Thane 💋 Call Girls 7738631006 💋 Call Girls in Thane Escort service book now. ...
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 

Apple Watch and WatchKit - A Technical Overview

  • 1.
  • 2. Apple Watch and Apple WatchKit
  • 3. • A look at Apple Watch • WatchKit • Structure and life cycle • WatchKit Framework • Creating watch app Content
  • 4. A look at Apple Watch
  • 6. Sensors • Gyroscope • Measures angular velocity • Determine orientation of device • Accelerometer • Measures non-gravitational acceleration • Type of activity • Intensity of activity • Heart Rate monitor • Measure heart response to exercise • Physical training apps
  • 7. Connectivity • Bluetooth Connectivity • Connectivity with phone • Connectivity with headphone or headsets. • Wireless Charging
  • 8. Input Buttons and Gestures • Buttons • Digital crown • Conversation button • Gestures • Vertical scrolling • Horizontal swipe • Left edge swipe • Force touch • Tap
  • 9. Communication • Glance • Notification • Short-look interface • Long-look interface • Watch Interface • Hierarchical navigation interface • Page-base navigation interface
  • 11. WatchKit The apple watch requires an iPhone paired with it to run the apps without an iPhone the watch apps will not work. For creating watch app we need two separate bundles • WatchKit app The watch kit app contains only storyboard and resource files associated with our apps UI. • WatchKit extension The WatchKit extension contains the code for managing the WatchKit app’s UI and for responding user interactions. Since both of these bundle are packed in side the ios app so during the installation of the app the system prompts the user to install the watchkit app when a paired watch is present
  • 14. Communication between Watchkit App VS Watchkit extension
  • 16. Watch app life cycle
  • 18. A look at WatchKit framework The whole apple watch is managed by the few classes the most used are as • WKinterfaceController • WKUserNotificationInterfaceController • WKInterfaceDevice • WKInterfaceObject
  • 19. A look at WatchKit framework WKInterfaceController in WatchKit is the same as UIViewController in UIKit. WKInterfaceController is a lot more restricted and has a different life cycle. There are different methods to work with as following. UIViewController WKInterfaceController likeviewDidLoad Init loadView awakeWithContext ViewWillAppear WillActivate ViewWillDisappear didDeactivate
  • 20. A look at WatchKit framework • WKUserNotificationInterfaceController Its a WKInterfaceController subclass that is used to display custom notification interfaces. • WKInterfaceDevice This class contains basic information related to the iWatch. This includes screen bounds, scale and current locale. You can also use it to manage your images cache. WatchKit allows you to store up to 20 MB of cached images on the iWatch.
  • 21. A look at WatchKit framework • WKInterfaceObject This is the base class for all UI controls supported by WatchKit. As we cannot use UI views from UIKit. All we can do is use the ones that WatchKit provides. • WKInterfaceButton • WKInterfaceDate • WKInterfaceGroup • WKInterfaceImage • WKInterfaceLabel • And more
  • 22. A look at WatchKit framework • Watchkit layout WatchKit does not use Auto layout to position it’s element. This is because it might have been too complex for the slow iWatch. Instead we have a layout system that positions elements relative to each other in a horizontal or vertical order.
  • 23. A look at WatchKit framework • Glances The apple watch is designed so that user can have a quick access to the information from the app on iPhone. This is achieved by “Glance Interface controller” which is non- scrollable view with the precise info and user can launch the app by tapping in it or can close it. Apple prohibits using any interfaceObject on this screen because “Glances do not support interactivity—tapping on a glance automatically launches your WatchKit app”
  • 24. A look at WatchKit framework • Static notification interfaces It is a simplified version of notification appearance, it contains static image and text. Only notification text can be changed. • Dynamic notification interfaces It allow you to specify a custom controller to display notification. Dynamic notification are not interactive and should be designed to display the info, tapping on it will launch the application
  • 25. Sharing data with containing iOS app This can be done with by different methods which are as following • By NSUserDefault we can create and init the object of user default by initiating with initwithSuiteName • By NSFilemanager we can create a shared container using group id [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:@"gr oup.com.swenggco.TodayExtensionApp"];
  • 26. Sharing data with containing iOS app • By openParentApplication:reply: method we can communicate directly with containing app by calling the openParentApplication:reply: method, which iOS launches or wakes the containing iOS app in the background and calls the application:handleWatchKitExtensionRequest:reply: m ethod of its app delegate. The app delegate performs the request using the provided dictionary and then returns a reply to the WatchKit extension.
  • 27. Creating watch app • First we need to add watch app target to the iOS project. To do this, select your project in the explorer and click the + button at the bottom of the project.
  • 29. Select WatchKit App and hit Next
  • 30. Select Finish when you are done
  • 31. Now we have two new folders in project directory
  • 32. Setup an app group App Groups are the scheme iOS uses to allow different apps to share data. If the apps have the right entitlements and proper provisioning, they can access a shared directory outside of their normal iOS sandbox. To create groups we have to turn on “app groups” entitlement in Xcode for app and also for the extension. When you flip that switch, Xcode will talk to the developer center to configure your app ID for app groups. Then you can select a group or create a new one.
  • 33. Setup an app group
  • 34. Setup an app group
  • 35. Share a classes or framework • We can also use a class a framework in watch extension from the main project by selecting extension from “Target membership” in “file inspector”.
  • 36. Share a classes or framework
  • 37. Now every thing is setup developing the watch app. Add more WKinterfaceController start building your watch app.
  • 39. Need help launching your great Apple Watch App. Swenggco Software Email: sales@swenggco-software.com Web: www.swenggco-software.com Thanks