Top Banner
watchOS 2 - native apps are coming Mateusz Klimczak
17

[CocoaHeads Tricity] watchOS 2 - native apps are coming

Apr 07, 2017

Download

Software

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: [CocoaHeads Tricity] watchOS 2 - native apps are coming

watchOS 2 - native apps are comingMateusz Klimczak

Page 2: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Agenda

! watchOS 2.0 – what’s new?

! App components

! Let’s build a simple app!

Page 3: [CocoaHeads Tricity] watchOS 2 - native apps are coming

watchOS 2.0 – what’s new

! Architecture changes

! More access to the hardware

! Storing data in Keychain

! Tetherless Wi-Fi

! New interface objects

! Animations

Page 4: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Architecture changes

! All interactions with the watch app must be communicated back to the iPhone

! Hence the watch has this inherent reliance on the iPhone in order to work

! Apps took a long time to load

Page 5: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Architecture changes

! No need to send data back and forth between the containing iOS app and the watch app

! Communication has changed: Shared App Groups are no longer available, you need to use Watch Connectivity Framework instead

Page 6: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Communication

! With Watch Connectivity Framework you can pass files and data back and forth between the watch and its paired iPhone

! If both apps are running in the foreground, then the communication is live, otherwise it happens in the background so that the data or files is available when the receiving app is launched

! WCSession object handles all the communication between the two devices (accessed through defaultSession singleton object)

Page 7: [CocoaHeads Tricity] watchOS 2 - native apps are coming

More access to the Hardware

! Accelerometer

! Microphone

! Heart rate monitor

! Taptic Engine

! Complications

! Digital crown

Page 8: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Animations

! In old approach you had to cycle through a pre-generated series of images (it is still available)

! Now you can animate changes to the following properties of WKInterfaceObject: ! alpha

! width and height

! vertical and horizontal alignment

! background color

! layout group insets

Page 9: [CocoaHeads Tricity] watchOS 2 - native apps are coming

New interface objects

! Movie control

! Picker control

! Alerts and Action Sheets

Page 10: [CocoaHeads Tricity] watchOS 2 - native apps are coming

App components

! Notifications

! Glances

! Complications

Page 11: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Notifications

! Apple Watch takes full advantage of the existing interactive notification support on iOS

! If your app supports notification, Apple Watch displays those notifications at appropriate times

! iOS decides whether to display that notification on the iPhone or on the Apple Watch

! There are 2 types of notifications: Short-Look and Long-Look.

Page 12: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Short-Look notifications

! The Short-Look interface is a nonscrolling screen that cannot be customized

! The system uses a template to display the app name and icon along with the title string

! If the user raises their wrist after a slight pause, the Short-Look notification will transition to the Long-Look notification

Page 13: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Long-Look notifications

! The Long-Look interface is a scrollable screen that displays the notification’s content and any associated action buttons

! If you do not provide a custom notification interface, Apple Watch displays a default interface that includes your app icon, the title string of the notification and the alert message

Page 14: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Glances

! A glance is a supplemental way for the user to view important information from your app

! It is separated from your app’s other interface controllers

! No all apps need a glance

! A glance provides immediately relevant information in a timely manner

! Glances should be quick and easy to read, so user won’t have to stop and examine it closely

! Glances do not support interactivity – tapping on a glance automatically launches your WatchKit app

Page 15: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Complications

! Complications are small visual elements that appear on the watch face and convey important information to the user

! Complication are visible whenever the user looks at Apple Watch to check the time

! Complications can be updated by: ! Explicitly when you WatchKit extensions is

running

! Ask ClockKit to wake your WatchKit extension at periodic intervals

! Use push notifications to update your data

! Transfer time-sensitive data from your iOS app

Page 16: [CocoaHeads Tricity] watchOS 2 - native apps are coming

Let’s code something!

Page 17: [CocoaHeads Tricity] watchOS 2 - native apps are coming

The end

! Thanks for your attention!

! Any questions?