SlideShare a Scribd company logo
1 of 18
WatchKit
Create Your First WatchKit App
Introduction
 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 WatchKit app contains only storyboard and
resource files associated with our apps UI.
 WatchKit extension: The WatchKit extension contains the code
for managing the WatchKit apps UI and responding user
interactions.
App Structure
Watch app Launching
WatchKit Framework
 The whole apple watch is managed by the few classes the most
used are as :
 WKInterfaceController
 WKUserInterfaceNotificationController
 WKInterfaceDevice
 WKInterfaceObject
WKInterfaceController
 WKInterfaceController in WatchKit is as 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.
WKUserInterfaceNotificationController
 The WKUserNotificationInterfaceController class manages a
dynamic user interface for a local or remote notification.
 After initializing your interface controller, WatchKit calls the
didReceiveRemoteNotification:withCompletion: or
didReceiveLocalNotification:withCompletion: method to
provide you with the payload data from the notification.
WKInterfaceDevice
 This class contains basic information related to the
iWatch.
 This includes:
 Screen bounds
 Scale
 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.
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..
Creating Watch App
 First create a new single view application iPhone project
and call it “WatchKitDemo.”
Create WatchKit Target
 Select New > Target... from Xcode's File menu and
choose WatchKit App from the iOS > Apple Watch section on
the left.
 Give the project name as “Watch” and uncheck include
notification scene and include Glance scene.
 When you click Finish, Xcode will create a number of files,
groups, and targets.
 Xcode will also create a scheme to run the WatchKit application
in the iOS Simulator and it will ask you whether it should
activate that scheme. Click Activate to activate it.
Project Anatomy
 By adding a WatchKit application to our project, Xcode has
created two targets for us,
 one for the WatchKit extension, Watch Extension,
 and one for the WatchKit application, Watch App.
WatchKit application
WatchKit Extension
Create the user interface
 Open the WatchKitDemo WatchKitApp folder and click on the
Interface.storyboard file.
 You should see a blank watch storyboard interface that you can drag UI
controls onto.
Run WatchKit App
 To run Watch application, Select Watch scheme from the
Scheme List and select iPhone+Apple Watch Simulator.
Output
Create your First Watchkit App

More Related Content

What's hot

Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
Ahsanul Karim
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
Ahsanul Karim
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
Ahsanul Karim
 
Beginning android application development wei meng lee
Beginning android application development wei meng leeBeginning android application development wei meng lee
Beginning android application development wei meng lee
Hiệp Lê Quang
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
Ahsanul Karim
 

What's hot (20)

LaunchKit
LaunchKitLaunchKit
LaunchKit
 
Lecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick OverviewLecture 2(b) Android Internals A Quick Overview
Lecture 2(b) Android Internals A Quick Overview
 
AppleWatch_Presentation
AppleWatch_PresentationAppleWatch_Presentation
AppleWatch_Presentation
 
Day: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application DevelopmentDay: 2 Environment Setup for Android Application Development
Day: 2 Environment Setup for Android Application Development
 
Day 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver ComponentDay 6: Android BroadcastReceiver Component
Day 6: Android BroadcastReceiver Component
 
Utilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps androidUtilizando expresso uiautomator na automacao de testes em apps android
Utilizando expresso uiautomator na automacao de testes em apps android
 
Android MapView and MapActivity
Android MapView and MapActivityAndroid MapView and MapActivity
Android MapView and MapActivity
 
An Implementation Tour to AngularJS
An Implementation Tour to AngularJSAn Implementation Tour to AngularJS
An Implementation Tour to AngularJS
 
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
 
Local Notification Tutorial
Local Notification TutorialLocal Notification Tutorial
Local Notification Tutorial
 
Utilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps AndroidUtilizando Espresso e UIAutomator no Teste de Apps Android
Utilizando Espresso e UIAutomator no Teste de Apps Android
 
Twitter is acquired | Techugo Private Limited
Twitter is acquired | Techugo Private LimitedTwitter is acquired | Techugo Private Limited
Twitter is acquired | Techugo Private Limited
 
Android Test Automation Workshop
Android Test Automation WorkshopAndroid Test Automation Workshop
Android Test Automation Workshop
 
watch_kit_v_1.0
watch_kit_v_1.0watch_kit_v_1.0
watch_kit_v_1.0
 
Android Basics
Android BasicsAndroid Basics
Android Basics
 
04 activities - Android
04   activities - Android04   activities - Android
04 activities - Android
 
Beginning android application development wei meng lee
Beginning android application development wei meng leeBeginning android application development wei meng lee
Beginning android application development wei meng lee
 
Day 4: Android: UI Widgets
Day 4: Android: UI WidgetsDay 4: Android: UI Widgets
Day 4: Android: UI Widgets
 
GDG School Android Workshop
GDG School Android WorkshopGDG School Android Workshop
GDG School Android Workshop
 
Android
AndroidAndroid
Android
 

Similar to Create your First Watchkit App

Similar to Create your First Watchkit App (20)

I WATCH DOCUMENTATION
I WATCH DOCUMENTATIONI WATCH DOCUMENTATION
I WATCH DOCUMENTATION
 
Apple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical OverviewApple Watch and WatchKit - A Technical Overview
Apple Watch and WatchKit - A Technical Overview
 
Your 1st Apple watch Application
Your 1st Apple watch ApplicationYour 1st Apple watch Application
Your 1st Apple watch Application
 
WatchOS Architecture
WatchOS ArchitectureWatchOS Architecture
WatchOS Architecture
 
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
 
Apple watch
Apple watchApple watch
Apple watch
 
Apple Watch Kit trainning slide [team iOS - RikkeiSoft]
Apple Watch Kit trainning slide [team iOS - RikkeiSoft]Apple Watch Kit trainning slide [team iOS - RikkeiSoft]
Apple Watch Kit trainning slide [team iOS - RikkeiSoft]
 
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
 
Build apps for Apple Watch
Build apps for Apple WatchBuild apps for Apple Watch
Build apps for Apple Watch
 
Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016
Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016
Build Apps for Apple Watch - Francesco Novelli - Codemotion Milan 2016
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Introduction of Xcode
Introduction of XcodeIntroduction of Xcode
Introduction of Xcode
 
When You Can’t Go All In on SwiftUI, Build a Hybrid UI App Instead!
When You Can’t Go All In on SwiftUI, Build a Hybrid UI App Instead!When You Can’t Go All In on SwiftUI, Build a Hybrid UI App Instead!
When You Can’t Go All In on SwiftUI, Build a Hybrid UI App Instead!
 
iPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basicsiPhone SDK dev sharing - the very basics
iPhone SDK dev sharing - the very basics
 
I phone first app ducat
I phone first app ducatI phone first app ducat
I phone first app ducat
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
 
What’s new in Xcode 8? – Future of Native App Development Opportunities
What’s new in Xcode 8? – Future of Native App Development OpportunitiesWhat’s new in Xcode 8? – Future of Native App Development Opportunities
What’s new in Xcode 8? – Future of Native App Development Opportunities
 
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 ?
 

Recently uploaded

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Create your First Watchkit App

  • 2. Introduction  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 WatchKit app contains only storyboard and resource files associated with our apps UI.  WatchKit extension: The WatchKit extension contains the code for managing the WatchKit apps UI and responding user interactions.
  • 5. WatchKit Framework  The whole apple watch is managed by the few classes the most used are as :  WKInterfaceController  WKUserInterfaceNotificationController  WKInterfaceDevice  WKInterfaceObject
  • 6. WKInterfaceController  WKInterfaceController in WatchKit is as 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.
  • 7. WKUserInterfaceNotificationController  The WKUserNotificationInterfaceController class manages a dynamic user interface for a local or remote notification.  After initializing your interface controller, WatchKit calls the didReceiveRemoteNotification:withCompletion: or didReceiveLocalNotification:withCompletion: method to provide you with the payload data from the notification.
  • 8. WKInterfaceDevice  This class contains basic information related to the iWatch.  This includes:  Screen bounds  Scale  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.
  • 9. 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..
  • 10. Creating Watch App  First create a new single view application iPhone project and call it “WatchKitDemo.”
  • 11. Create WatchKit Target  Select New > Target... from Xcode's File menu and choose WatchKit App from the iOS > Apple Watch section on the left.
  • 12.  Give the project name as “Watch” and uncheck include notification scene and include Glance scene.
  • 13.  When you click Finish, Xcode will create a number of files, groups, and targets.  Xcode will also create a scheme to run the WatchKit application in the iOS Simulator and it will ask you whether it should activate that scheme. Click Activate to activate it.
  • 14. Project Anatomy  By adding a WatchKit application to our project, Xcode has created two targets for us,  one for the WatchKit extension, Watch Extension,  and one for the WatchKit application, Watch App. WatchKit application WatchKit Extension
  • 15. Create the user interface  Open the WatchKitDemo WatchKitApp folder and click on the Interface.storyboard file.  You should see a blank watch storyboard interface that you can drag UI controls onto.
  • 16. Run WatchKit App  To run Watch application, Select Watch scheme from the Scheme List and select iPhone+Apple Watch Simulator.