Слайд 1Apple Watch Development
Introduction to Watch Kit
Mike Bluestein @mikebluestein
Слайд 2Apple Watch
Requires an iPhone (5c or above)
Connects to watch via BlueTooth
golfwatchscorecard.com
Слайд 32 Watch Sizes
38mm and 42 mm
Same aspect ratio
Слайд 4Apple Provided Apps
Some Apple apps and features work without phone
These apps
have access to sensor data
Full animation capability
Слайд 53rd Party Apps
Run entirely on iPhone
Installed when installed on paired iPhone
Watch
is for UI presentation layer only
Limited SDK - Watch Kit
“Full” SDK later this year
Слайд 6Yes You Can
Create simple user interface
Present data from the parent iPhone
application
Present notifications
Present glaces
Create image-based animations
Слайд 7No You Can’t
Run apps without a connect iPhone
Build watch-only apps
Capture biometric
sensor data
Capture motion data
Create timing based animations
Слайд 8App Structure
Parent iPhone App
Watch Extension
Watch App
Shared Code
Слайд 9UI Navigation
Two types of UI navigation
Page-based
Hierarchical
Cannot mix them (unless using a
modal controller)
Слайд 10Layout
Groups
Easy to use
Far less complex than auto-layout
Слайд 11Controls
New set of UI controls
Designed specifically for Apple Watch
Easy to use
Not
as full-featured as UIKit
Слайд 12Menus
Open with force touch gesture
Controls for menu and menu items
Handle selection
in WKInterfaceController
Слайд 13Watch App
Contains the user interface and static resources
Storyboards are required
No code
runs on the watch
Слайд 14Watch Extension
Runs on the phone
Has its own lifecycle
Handles user interactions raised
from watch app
Updates user interface on watch remotely
Performs shorter running tasks
Access shared data
Слайд 15iPhone App
Parent app to the watch app
Performs longer running tasks
Access shared
data
Does not share security
Separate process from watch extension
Слайд 16App Groups
Share data between iPhone and Watch Extension
Can share files,
settings, database
Requires shared group entitlement
Слайд 17Communication
App groups
OpenParentApplication
HandleWatchKitExtensionRequest
Darwin notifications
Слайд 18WormHoleSharp
Bridge between iOS app and Watch Extension
Pass data or commands
github.com/Clancey/WormHoleSharp
I’m being
controlled from Apple Watch!
Слайд 19Images
SetImage - works with UIImage
SetImageData - works directly with bitmap data
Both
send data from iPhone to Apple Watch
SetImageNamed - sends only name to watch
Image is loaded from bundle or cache
Used to create animation
20 MB cache with simple cache API
Слайд 20Notifications
Local or remote notifications from iPhone
Short-look - initial display of notification
to user
Long-look - displayed after user looks at short look for a few seconds
Long-look is scrollable and can have action buttons
Слайд 21Glances
Quick access to brief, relevant information
Swipe up from watch face to
access
Not interactive
One glance controller per app
Tap glance to open watch app
Слайд 22App Store Requirements
No alpha in images
Use 42 mm for screenshots
No mention
of watch in iPhone app images
Other?