Slide 1

Slide 1 text

RUBY IS ⌚ING #INSPECT 2015 ! BORIS BÜGLING - @NEONACHO

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

COCOAPODS

Slide 4

Slide 4 text

CONTENTFUL

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

!!!!

Slide 7

Slide 7 text

AGENDA ▸ ᴡᴀᴛᴄʜ ▸ Android Wear ▸ Developing for both with RubyMotion ▸ Building a simple app

Slide 8

Slide 8 text

ᴡᴀᴛᴄʜ

Slide 9

Slide 9 text

WATCHOS 1.X ▸ Notifications ▸ Glances ▸ WatchKit apps

Slide 10

Slide 10 text

NOTIFICATIONS

Slide 11

Slide 11 text

GLANCES

Slide 12

Slide 12 text

WATCHKIT

Slide 13

Slide 13 text

WATCHOS 2.X ▸ Apps run natively on the watch ▸ Custom complications

Slide 14

Slide 14 text

!!!

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

COMPLICATIONS

Slide 17

Slide 17 text

ANDROID WEAR

Slide 18

Slide 18 text

ANDROID WEAR ▸ Enhanced Notifications ▸ Wearable Apps

Slide 19

Slide 19 text

ENHANCED NOTIFICATIONS

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

WEARABLE APPS

Slide 22

Slide 22 text

=> PRETTY MUCH THE SAME

Slide 23

Slide 23 text

=> RUBYMOTION

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

RAKEFILE Motion::Project::App.setup do |app| [...] app.target 'WatchApp', :watchapp end

Slide 26

Slide 26 text

RESOURCES ▸ Interface.storyboard ▸ Asset catalogs

Slide 27

Slide 27 text

WATCHAPP/RAKEFILE [...] require 'ib/tasks' IB::RakeTask.new do |project| project.resource_directories = ['watch_app'] end

Slide 28

Slide 28 text

EXTENSION DELEGATE class ExtensionDelegate def applicationDidFinishLaunching [...] end def applicationDidBecomeActive [...] end def applicationWillResignActive [...] end end

Slide 29

Slide 29 text

INTERFACE CONTROLLER class InterfaceController < WKInterfaceController extend IB def initWithContext(context) if super [...] self end end def willActivate [...] end def didDeactivate [...] end end

Slide 30

Slide 30 text

WKINTERFACECONTROLLER ▸ Navigation ▸ Presentation ▸ Handoff ▸ Handle notification actions ▸ Communicate with parent app

Slide 31

Slide 31 text

RUNNING THE APP IN THE SIM rake watch

Slide 32

Slide 32 text

ANDROID WEAR ISN'T REALLY SUPPORTED, YET

Slide 33

Slide 33 text

BUILDING A SIMPLE APP

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

MULTIPEER CONNECTIVITY!

Slide 37

Slide 37 text

AVAILABLE FRAMEWORKS

Slide 38

Slide 38 text

CFNetwork.framework ClockKit.framework Contacts.framework CoreData.framework CoreFoundation.framework CoreGraphics.framework CoreLocation.framework CoreMotion.framework EventKit.framework Foundation.framework

Slide 39

Slide 39 text

HealthKit.framework HomeKit.framework ImageIO.framework MapKit.framework MobileCoreServices.framework PassKit.framework Security.framework UIKit.framework WatchConnectivity.framework WatchKit.framework

Slide 40

Slide 40 text

BT APIS ARE PRIVATE :(

Slide 41

Slide 41 text

OTHER OPTIONS ▸ NSURLSession via Wi-Fi ▸ WatchConnectivity.framework to talk via the phone

Slide 42

Slide 42 text

HEALTHKIT.FRAMEWORK ▸ not usable in the Watch simulator

Slide 43

Slide 43 text

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(WKHapticTypeStart)

Slide 44

Slide 44 text

BUT ALSO NOT USABLE IN THE SIM

Slide 45

Slide 45 text

DEMO

Slide 46

Slide 46 text

TIPS

Slide 47

Slide 47 text

printf DEBUGGING IS GREAT!

Slide 48

Slide 48 text

MMWORMHOLE ▸ watchOS 1.0: CFNotificationCenter ▸ watchOS 2.0: WatchConnectivity.framework

Slide 49

Slide 49 text

FORCE QUIT APPS ▸ Long press until "reboot" menu ▸ Long press again

Slide 50

Slide 50 text

IF IN DOUBT, REBOOT THE WATCH :)

Slide 51

Slide 51 text

WHAT HAVE WE LEARNED? ▸

Slide 52

Slide 52 text

THANK YOU!

Slide 53

Slide 53 text

▸ https://developer.apple.com/watch/human-interface-guidelines/ ▸ https://developer.apple.com/library/prerelease/watchos/ documentation/General/Conceptual/AppleWatch2TransitionGuide/ ▸ https://developer.android.com/wear/index.html ▸ https://github.com/shu223/watchOS-2-Sampler ▸ http://www.kristinathai.com/category/watchkit/ ▸ http://www.slideshare.net/peterfriese/introduction-to-android- wear

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

@NeoNacho [email protected] http://buegling.com/talks