The keynote slideshow explains about the watch os architecture and watch app lifecycle. It explains about how watch app is linked with iOS application.
2. What? When?
WatchOS is the operating system for Apple Watch,
developed and release by Apple on April 24, 2015 along with
Apple watch series 1.
It is based on iOS operating system, and has got many
similar features.
Its API is called WatchKit.
4. Architecture
• The watch app consists of two bundles, namely the Watch
app bundle and WatchKit extension bundle.
• Watch app bundle contains your app’s storyboards.
• WatchKit extension contains your app’s code and
additional resources.
• Communication between them and iOS application is
possible through Watch Connectivity framework.
5. Apple Watch iPhone
WatchOS iOS
WatchApp iOS App
WatchKit
Extension
Watch
Connectivity
Framework
The Relationship
6. The Extension Delegate
• WatchKit extension contains a extension object, called
WKExtension and a corresponding delegate (protocol)
object called WKExtensionDelegate.
• WKExtension object is shared and is available when your
interface is loaded, or when your custom notification
appears or even when your complications are being
updated.
• At app launch, the WatchKit extension automatically
instantiates the extension delegate class. So, all you have
to do is to put your code in the source files provided.
8. Watch App:Life Cycle
Foreground
Background
Not Running
Inactive
Active
Background
Suspend
1. applicationDidFinishLaunching
2. applicationDidBecomeActive
or
applicationWillResignActive
1
2
3
3. applicationWillEnterForeground
or
applicationDidEnterBackground
9. • At launch time, the watch app transitions from inactive state
directly to active state.
• It transitions to inactive state once user exits the app, and
later may transition to background or even suspended state.
• If the app is in the dock or its complication is on the active
watch face, the app remains in suspended state, otherwise, it
transitions to not running state.
• The delivery of life cycle events may be intermixed with
activation and deactivation events of the apps interface
controllers. The order is not guaranteed.
10. The Scenes
• Each scene in watch app storyboard is managed by a
single InterfaceController object.
• This is similar to view controller in iOS.
• The interface controller is a subclass of
WKInterfaceController.
11. How to Build?
Apple Watch iPhone
iOS App
Watch App
Handles Watch App Alone Handles iOS App Alone