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
290
Cross-platform Swift
neonichu
3
880
Swift Package Manager
neonichu
2
320
Swift Package Manager
neonichu
0
50
📺
neonichu
0
2k
Cross-Platform Swift
neonichu
0
74
Swift Package Manager
neonichu
6
4.3k
Other Decks in Programming
See All in Programming
Macとオーディオ再生 2024/11/02
yusukeito
0
370
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Jakarta EE meets AI
ivargrimstad
0
670
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
CSC509 Lecture 13
javiergs
PRO
0
110
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
960
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Remix on Hono on Cloudflare Workers
yusukebe
1
300
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
Featured
See All Featured
Being A Developer After 40
akosma
87
590k
RailsConf 2023
tenderlove
29
900
Building a Scalable Design System with Sketch
lauravandoore
459
33k
The Language of Interfaces
destraynor
154
24k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Practical Orchestrator
shlominoach
186
10k
Become a Pro
speakerdeck
PRO
25
5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Agile that works and the tools we love
rasmusluckow
327
21k
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