kkbox wwdc17 watchos - dada

70
WWDC 17 KKBOX iOS Team - Dada

Upload: liyao-chen

Post on 22-Jan-2018

2.071 views

Category:

Technology


0 download

TRANSCRIPT

WWDC 17KKBOX iOS Team - Dada

Sessions

- What’s New in watchOS

- The Life of a watchOS App

- What's New in Safari View Controller

- Customized Loading in WKWebView

watchOS 4

FeaturesApple Music

Workout Session

SiriKit

Dock

FeaturesApple Music

Workout Session

SiriKit

Dock

FeaturesApple Music

Workout Session

SiriKit

Dock

FeaturesApple Music

Workout Session

SiriKit

Dock

FeaturesApple Music

Workout Session

SiriKit

Dock

Enhancement

Enhancement

- New Group Layout Property

- Water Lock API

- Vertical Paging View

- Scroll to Top, Center, Down

- Auto Rotate

5 New API features for UI

New Group Layout - Overlap

Water Lock API

Only for Workout Session and Navigation Session

Vertical Paging View

Scroll to Top, Center, Down

Auto Rotate

Enhancement

Unified process runtime

watchOS 3 or early version

Two processes for different usages.

watchOS 4

Processes are unified in runtime.

No need to change any code.

watchOS 4

- Touch latency

- Lauch performance

- Pan gesture performance

- Upped-memory limits accordingly

Benefits

Enhancement

Frontmost app state

Background app refresh

Background modes

Frontmost App State

Frontmost App State

- What does it mean?

Frontmost App State - Benefits

- Extend runtime

- URLSession

- WatchConnectivity

- Haptic playback

- Notification handling

Background App Refresh

A few APIs Changed

Background mode

New Background modes

- Workout

- Audio Recording

- Navigation

- Core Bluetooth

Workout

- Hardware pause/resume

- Workout segments

- Workout routes

- Supports enabling water lock mode

Audio Recording

- Custom recording controls

- In-line processing (real time language translation)

- Background recording

- Start from foreground

Audio Recording

- Recording

AVAudioInputNode (AVAudioEngine)

AVAudioRecorder

AVAudioSession recording permissions

- Formats supportedAAC-LC, AAC-ELD, HE-AAC, HE-AACv2, MP3 (decoding only), Opus

Navigation

- Appears on wrist raise

- Audio and haptics from background

- Supports enabling water lock mode

- Start from foreground

Core Bluetooth

- Limited to two peripherals

- Central support only

- Minimum connection interval of 30ms foreground (120ms

background)

- Background running apps can only connect (not scan)

- Peripherals disconnect when app is suspended

Safari View Controller

Matching your app’s style

iOS 11 improvements

Tailoring Safari View Controller

Matching your app’s style

iOS 11 improvements

Tailoring Safari View Controller

New Look

Customizing Color

Customizing Dismiss Button

Customizing Share Sheet

Bar Collapsing

5 Things about UI

New Look

Customizing Color

Matching your app’s style

iOS 11 improvements

Tailoring Safari View Controller

Drag and Drop

Status Bar Styling

Webpage window.open() window.close()

privacy

browsing mode is no longer tied to Safari’s

5 Improvement

Drag and Drop

Status Bar Styling

Webpage window.open() window.close()

Privacy

Browsing mode is no longer tied to Safari’s

5 Improvement

Privacy

- On iOS 11, Safari View Controller will have a separate persistent data store in each app

that it's used in.

- This means that cookies, local storage, and other browsing data will be contained within

your app and scoped to your app.

- And this means that the user won’t automatically be logged in to whatever accounts they

were logged into in Safari.

- What this does is it will prevent cross-app tracking of user’s browsing activity that you and

your users may not have even been aware about.

- And ultimately, it helps keep users’ browsing activity private and scoped within your app.

WKWebView

Manage cookies

Filter unwanted content

Provide custom resources

Manage cookies

Filter unwanted content

Provide custom resources

WKHTTPCookieStore

- Add and remove individual cookies

- Access all cookies visible to a WKWebView

- Including HTTP-only cookies

- Observe the cookie store for changes

Manage cookies

Filter unwanted content

Provide custom resources

WKContentRuleList

- Same syntax as Content Blocker extensions for Safari (JSON)

- Make content invisible

- Make insecure loads secure

- WebKit compiles your rules into efficient bytecode

Manage cookies

Filter unwanted content

Provide custom resources

WKURLSchemeHandler

- Allows your app to handle resource loads for a URL scheme

- Only custom URL schemes that WebKit doesn’t handle itself

- You cannot use “local” as your URL scheme

Load something in your view that uses your scheme

Simple protocol you implement

The WKURLSchemeTask sent to your handler represents a resource load

SPrepare a response

SDeliver the response

Q & A