Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Building watchOS apps
Search
Boris Bügling
July 13, 2015
Programming
2
190
Building watchOS apps
An introduction to building watchOS apps, given at Mobile Optimized 2015 in Minsk.
Boris Bügling
July 13, 2015
Tweet
Share
More Decks by Boris Bügling
See All by Boris Bügling
Testing ⌚️ Apps and Other Extensions
neonichu
1
4.6k
Cross-platform Swift
neonichu
4
18k
Building better API clients in Swift
neonichu
1
290
Cross-platform Swift
neonichu
3
890
Swift Package Manager
neonichu
2
320
Swift Package Manager
neonichu
0
50
📺
neonichu
0
2k
Cross-Platform Swift
neonichu
0
75
Swift Package Manager
neonichu
6
4.3k
Other Decks in Programming
See All in Programming
HTML/CSS超絶浅い説明
yuki0329
0
190
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
180
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.3k
生成AIでGitHubソースコード取得して仕様書を作成
shukob
0
630
Beyond ORM
77web
11
1.6k
선언형 UI에서의 상태관리
l2hyunwoo
0
270
DMMオンラインサロンアプリのSwift化
hayatan
0
190
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
26
6k
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
240
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Practical Orchestrator
shlominoach
186
10k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Fireside Chat
paigeccino
34
3.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Transcript
BUILDING WATCHOS APPS MOBILEOPTIMIZED 2015 BORIS BÜGLING - @NEONACHO
COCOAPODS
CONTENTFUL
None
!!!!
ᴡᴀᴛᴄʜ
WATCHOS 1.X ▸ Notifications ▸ Glances ▸ WatchKit apps
NOTIFICATIONS
GLANCES
WATCHKIT
WATCHOS 2.X ▸ Apps run natively on the watch ▸
Custom complications
!!!
None
COMPLICATIONS
ARCHITECTURE
None
WATCHOS 2 Extension phone => watch
RESOURCES ▸ Interface.storyboard ▸ Asset catalogs
EXTENSION DELEGATE class ExtensionDelegate: NSObject, WKExtensionDelegate { func applicationDidFinishLaunching() {
} func applicationDidBecomeActive() { } func applicationWillResignActive() { } }
INTERFACE CONTROLLER class InterfaceController: WKInterfaceController { override func awakeWithContext(context: AnyObject?)
{ super.awakeWithContext(context) } override func willActivate() { super.willActivate() } override func didDeactivate() { super.didDeactivate() } }
WKINTERFACECONTROLLER ▸ Navigation ▸ Presentation ▸ Handoff ▸ Handle notification
actions ▸ Communicate with parent app
DESIGN
If you measure interactions with your iOS app in minutes,
you can expect interactions with your Watch app to be measured in seconds.
PRINCIPLES ▸ Lightweight interactions ▸ Holistic design ▸ Personal communication
LAYOUT ▸ based on horizontal or vertical groups ▸ very
similar to UIStackView ▸ two device sizes (38mm and 42mm) ▸ edge-to-edge, bezel provides margins
None
SOME EXAMPLES
None
None
None
None
None
BUILDING A SIMPLE APP
None
WATCHPRESENTER ▸ Remote controls Deckset instead ▸ Direct connection to
the Mac ▸ Shows a preview of the slides ▸ Measures heartrate to display the "most exciting" slide ▸ Taps you if you're running out of time
MULTIPEER CONNECTIVITY!
AVAILABLE FRAMEWORKS
CFNetwork.framework ClockKit.framework Contacts.framework CoreData.framework CoreFoundation.framework CoreGraphics.framework CoreLocation.framework CoreMotion.framework EventKit.framework Foundation.framework
HealthKit.framework HomeKit.framework ImageIO.framework MapKit.framework MobileCoreServices.framework PassKit.framework Security.framework UIKit.framework WatchConnectivity.framework WatchKit.framework
BT APIS ARE PRIVATE :(
OTHER OPTIONS ▸ NSURLSession via Wi-Fi ▸ WatchConnectivity.framework to talk
via the phone
HEALTHKIT.FRAMEWORK let anchorValue = Int(HKAnchoredObjectQueryNoAnchor) let sampleType = HKObjectType.quantityTypeForIdentifier(HKQuantityTypeIdentifierHeartRate) let
heartRateQuery = HKAnchoredObjectQuery(type: sampleType!, predicate: nil, anchor: anchorValue, limit: 0) { (query, sampleObjects, deletedObjects, newAnchor, error) -> Void in guard let heartRateSamples = sampleObjects as?[HKQuantitySample] else {return} let sample = heartRateSamples.first let value = sample!.quantity.doubleValueForUnit(self.heartRateUnit) print(value) } heartRateQuery.updateHandler = // ...
None
HEALTHKIT.FRAMEWORK ▸ not usable in the Watch simulator
TAPTIC ENGINE typedef NS_ENUM(NSInteger, WKHapticType) { WKHapticTypeNotification, WKHapticTypeDirectionUp, WKHapticTypeDirectionDown, WKHapticTypeSuccess,
WKHapticTypeFailure, WKHapticTypeRetry, WKHapticTypeStart, WKHapticTypeStop, WKHapticTypeClick } WK_AVAILABLE_WATCHOS_ONLY(2.0); WKInterfaceDevice.currentDevice().playHaptic(.Start)
BUT ALSO NOT USABLE IN THE SIM
SPOTIFY REMOTE
DEMO
None
None
None
TIPS
printf DEBUGGING IS GREAT!
MMWORMHOLE ▸ watchOS 1.0: CFNotificationCenter ▸ watchOS 2.0: WatchConnectivity.framework
FORCE QUIT APPS ▸ Long press until "reboot" menu ▸
Long press again
IF IN DOUBT, REBOOT THE WATCH :)
WHAT HAVE WE LEARNED? ▸ Code isn't very different from
iOS apps ▸ But design very much is ▸ Rethink your app for the watch, don't port it ▸ If you can't - maybe you don't need a watch app
Don’t be afraid to not ship. @orta
THANK YOU!
▸ https://developer.apple.com/watch/human-interface-guidelines/ ▸ https://developer.apple.com/library/prerelease/watchos/ documentation/General/Conceptual/AppleWatch2TransitionGuide/ ▸ https://github.com/shu223/watchOS-2-Sampler ▸ http://www.kristinathai.com/category/watchkit/ ▸
https://realm.io/news/watchkit-mistakes/
@NeoNacho
[email protected]
http://buegling.com/talks