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
180
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
280
Cross-platform Swift
neonichu
3
870
Swift Package Manager
neonichu
2
320
Swift Package Manager
neonichu
0
49
📺
neonichu
0
1.9k
Cross-Platform Swift
neonichu
0
71
Swift Package Manager
neonichu
6
4.3k
Other Decks in Programming
See All in Programming
開発を加速する共有Swift Package実践
elmetal
PRO
0
420
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
1k
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
250
エラーレスポンス設計から考える、0→1開発におけるGraphQLへの向き合い方
bicstone
5
1.5k
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
230
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
390
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
今インフラ技術をイチから学び直すなら
yuhta28
1
140
Prolog入門
qnighy
4
1k
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
Featured
See All Featured
Designing the Hi-DPI Web
ddemaree
278
34k
Designing with Data
zakiwarfel
98
5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
653
58k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
27
7.4k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Pencils Down: Stop Designing & Start Developing
hursman
119
11k
Intergalactic Javascript Robots from Outer Space
tanoku
268
26k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
Why Our Code Smells
bkeepers
PRO
334
56k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
230
17k
Become a Pro
speakerdeck
PRO
22
4.9k
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