Top Banner
WWDC 2016 Anat Gilboa & Jesse Clayburgh
69

WWDC Overview

Apr 13, 2017

Download

Software

Anat Gilboa
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: WWDC Overview

WWDC 2016

Anat Gilboa & Jesse Clayburgh

Page 2: WWDC Overview

AmEx Core Mobile

Page 3: WWDC Overview

XCODE 8 OVERVIEW

Interface Builder Source Editing

Debugging Automatic Signing

Page 4: WWDC Overview

INTERFACE BUILDER

> Zoom capabilities

> !> Updated Size Class Bar

Page 5: WWDC Overview
Page 6: WWDC Overview

SOURCE EDITING EXTENSIONSCAPABILITIES:

* Add commands to the editor* Edit text* Change selections* Several commands for an extension

Page 7: WWDC Overview

JUST HAVE TO SET THE XCSOURCEEDITORCOMMANDINVOCATION IN INFO.PLIST AND IMPLEMENTING THIS PROTOCOL:

public protocol XCSourceEditorCommand : NSObjectProtocol { public func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: (NSError?) -> Void) -> Void }

> Signed with your Dev Profile and distributed in the App Store...

> Only question left is... is this the end of Alcatraz? (third-party extension/plugin manager for Xcode

plugins)

Page 8: WWDC Overview

DEBUGGING

Page 9: WWDC Overview

VIEW DEBUGGING

> Now supports blur rendering> Navigator filtering

Page 10: WWDC Overview

AUTOLAYOUT DEBUGGINGAMBIGUOUS LAYOUTS ARE REPORTED AS RUNTIME ISSUES

> listed in the Issue Navigator> Highlighted in the activity viewer, explained in the size

inspector

Page 11: WWDC Overview

THREAD SANITIZER* Like ASan (Address Sanitizer), finds memory corruption issues* Finds data races, thread leaks, unsafe calls in signal handlers* via Apple: 1. Edit Scheme – Diagnostics tab 2. “Enable Thread Sanitizer” checkbox 3. Build and Run 4. View all of the generated runtime issues 5. Can choose to break on every issue* The more runtime coverage, the better * Would be a good idea to run them on our tests

Page 12: WWDC Overview

MEMORY GRAPH DEBUGGING* New tool to find leaked and abandoned memory* Two graph styles * Root paths * Cycles* Logging integration available

Page 13: WWDC Overview

NEW SIGNING MODESAUTOMATICALLY

CREATES A SIGNING CERTIFICATE

CREATES AND UPDATES APP IDS

CREATES AND UPDATES PROVISIONING PROFILES

Page 14: WWDC Overview

NEW SIGNING MODECUSTOMIZED

> Manually created profiles only

APPLE RECOMMENDS USING AUTOMATIC

> Hopefully all of our signing troubles will go away...

Page 15: WWDC Overview

SWIFT 3 & FOUNDATIONLANGUAGE

* swift* swift-evolution

PACKAGE MANAGER* swift-package-manager* swift-llbuild

Page 16: WWDC Overview

CORE LIBRARIES

* swift-corelibs-xctest* swift-corelibs-foundation* swift-corelibs-libdispatch

Page 17: WWDC Overview

SWIFT LANGUAGE ADDITIONS:MAJOR UPDATES:

* Naming Guidelines (driven by SE-0005, SE-0006, SE-0023) * Strive for clarity-not terseness or verbosity * Capture essential information * Omit redundant information

Page 18: WWDC Overview

THE GREAT RENAMINGarray.appendContentsOf([2,3,4])array.insert(1, atIndex: 0)

turns intoarray.append(contentsOf: [2,3,4])array.insert(1, at: 0)

Page 19: WWDC Overview

THE GREAT RENAMING PT 2

Givenfunc myFunction(a: Int, b: Int, c: Int) { }myFunction(42, b: 57, c: 99)

turns intomyFunction(a: 42, b: 57, c: 99)

Page 20: WWDC Overview

STRINGLY TYPED OBJECTIVE-C CONSTANTS (SE-0033)

for constants defined astypedef NSString *NSNotificationName NS_EXTENSIBLE_STRING_ENUM;const NSNotificationName NSUserDefaultsDidChangeNotification;

Page 21: WWDC Overview

What used to be:let NSUserDefaultsDidChangeNotification: String

turns intoextension UserDefaults { class let didChangeNotification: NSNotification.Name}

Page 22: WWDC Overview

UNSAFEPOINTER NULLABILITY (SE-0002)

What used to be:let ptr : UnsafeMutablePointer<Int> = nilif ptr != nil { ptr.memory = 42}

turns intolet ptr : UnsafeMutablePointer<Int>? = nilif let ptr = ptr { ptr.memory = 42}

Page 23: WWDC Overview

COLLECTION INDEXING (SE-0065)i = collection.startIndexnext = i.successor()

turns intoi = collection.startIndexnext = collection.index(after: i)

Page 24: WWDC Overview

3D TOUCH !

Page 25: WWDC Overview

PEEK + POP

Peek - content “preview” of additional content

Page 26: WWDC Overview
Page 27: WWDC Overview
Page 28: WWDC Overview

PEEK + POP

Peek Quick Action

Page 29: WWDC Overview
Page 30: WWDC Overview

PEEK + POP

> Pop - commit to viewing that content + navigating to it

ENABLING FOR WEB VIEWS

WKWebView/UIWebView can enable via allowsLinkPreviewProperty

SFSafariViewController implements peek & pop automatically

Page 31: WWDC Overview

UIPREVIEWINTERACTION

> Advanced control of 3D touch interaction> Exposes force processing & haptic feedback to your

own user interface

Page 32: WWDC Overview

UIPREVIEWINTERACTION

Conform to UIPreviewInteractionDelegate Protocol

func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool)

Page 33: WWDC Overview

HOME SCREEN QUICK ACTIONS

> Static & defined in a plist or dynamic & defined at app’s first launch

> Can have both, but max of 4. Dynamic options appear after Static

> Contain System Icon, Custom Icon, or Address Book Contact Image

Page 34: WWDC Overview
Page 35: WWDC Overview

UIKitNEW INTERRUPTIBLE ANIMATION ANIMATION SUPPORT FOR

UIViewPropertyAnimator

> Allows users to retain control of animations and link them with gesture-based interactions

> New timing parameters: quadratic, cubic and spring

Page 36: WWDC Overview

UIKit

> UIRefreshControl and UITableViewDataSourcePrefetching for

UICollectionViews

Page 37: WWDC Overview

SPEECH RECOGNITIONNEW API THAT SUPPORTS CONTINUOUS SPEECH

RECOGNITIONlet recognizer = SFSpeechRecognizer()let request = SFSpeechURLRecognitionRequest(url: audioFileURL)recognizer?.recognitionTask(with: request, resultHandler: { (result, error) in print (result?.bestTranscription.formattedString)})

Page 38: WWDC Overview

SPEECH RECOGNITIONUSING APIS IN SPEECH.FRAMEWORK, YOU CAN PERFORM SPEECH

TRANSCRIPTION

> Data is temporarily stored on Apple's servers to increase the accuracy of speech recognition

Page 39: WWDC Overview

WATCH OS3 ⌚

Page 40: WWDC Overview

WATCH OS3

> Main goal: 2 seconds or less per interaction> Major UI Enhancements:

Launch apps from complications & new dock (replaces friends screen & glances)

Swipe edge-to-edge to change watch faces with their own individual complications

Page 41: WWDC Overview

WATCH BACKGROUND TASKS

> Background App Refresh WKApplicationRefreshBackgroundTask

Update app state in watch background so it’s much faster on launch

Page 42: WWDC Overview

WATCH BACKGROUND TASKS

> Background Snapshot Refresh WKSnapshotRefreshBackgroundTask

Update user interface in background: can push, pop, or present other interface controllers.

Page 43: WWDC Overview

WATCH BACKGROUND TASKS

> Background Watch Connectivity> Paired iPhone can receive info & launch app in

background, passing info.WKWatchConnectivityRefreshBackgroundTask

handleBackgroundTasks:

Page 44: WWDC Overview

WATCH BACKGROUND TASKS

> Workout apps can now run in background> Launch your watchOS workout app from your iOS app startWatchAppWithWorkoutConfiguration:comp

letion:

Page 45: WWDC Overview

COMPLICATIONS

Complications are small visual elements that appear directly on watch face.

* Launch apps right from tapping the complication * Watch face complication tells the system to keep the

associated app in a ready-to-launch state. * Guaranteed to receive 50 push updates per day.

Page 46: WWDC Overview
Page 47: WWDC Overview

APPLE PAY

> In-app paymentsSecurely provide payment and contact information to

pay for physical goods and services PKPaymentAuthorizationController

Page 48: WWDC Overview

CROWN ACCESS

WKCrownSequencer

> Current state of the digital crownWKCrownDelegate

> Receive notifications as the user rotates the crown

Page 49: WWDC Overview

FRAMEWORK INCLUSION

> Scenekit> SpriteKit

Page 50: WWDC Overview

AUTOLAYOUTAUTORESIZING MASKS

> If a view doesn't have constraints, the autoresizing masks will work views with constraints

> need to set translatesAutoresizingMaskIntoConstraints

== true> Otherwise if a view has constraints, then the

autoresizing masks are ignored

Page 51: WWDC Overview
Page 52: WWDC Overview

AUTOLAYOUTDESIGN AND RUNTIME CONSTRAINTS

> Designate intrinsic content size> Turn off ambiguity per view w/runtime constraints

Page 53: WWDC Overview

AUTOLAYOUTLAYOUT FEEDBACK LOOP

> A new way to find out which views are involved in a loop

> following argument passed on launchUIViewLayoutFeedbackLoopDebuggingThreshold

Page 54: WWDC Overview

SIRIKIT !

Page 55: WWDC Overview

SIRIKIT

Let Siri play with your app!

> Intents + Intents UI> Current SiriKit Support for domains of:

1. Audio or video calling2. Messaging3. Sending or receiving payments4. Searching photos5. Booking a ride6. Managing workouts

Page 56: WWDC Overview

SIRIKIT

> An Intents extension communicates your app’s content to Siri and Maps and performs the tasks associated

with any supported intents.> Optional UI extension for custom interface for your

content within the Siri or Maps interface. This extension is optional.

Page 57: WWDC Overview

SIRIKIT

User Request —> Intent Object —> Response Object

Page 58: WWDC Overview
Page 59: WWDC Overview

APPLE FILE SYSTEMDESCRIBED AS A "NEXT-GENERATION FILE SYSTEM

FOR APPLE PRODUCTS"SUPPOSED TO BE OPTIMIZED FOR SSD/FLASH BUT CAN ALSO BE

USED WITH TRADITIONAL HDDS.* Supports: * Cloning of Files and Directories * Exposed CoreOS API `int copyfile(const char *from, const char *to, copyfile_state_t state, copyfile_flags_t flags);` `int fcopyfile(int from_fd, int to_fd, copyfile_state_t, copyfile_flags_t flags);` * Snapshots * Fast Directory Sizing * Atomic Safe-Save

Page 60: WWDC Overview

APPLE PAY !

Page 61: WWDC Overview

APPLE PAY

> Present card from within app> Dynamic payment networks

> New sandbox testing environment> PassKit support for Apple Pay in places where UIKit is

not available> Apple Pay on web with Apple Pay JS

Page 62: WWDC Overview

NOTIFICATIONS

Page 63: WWDC Overview

NOTIFICATIONS

> User Notifications framework (UserNotifications.framework)

> Notification delivery based on time or location> User Notifications UI framework

> Modify push payload after delivery

Page 64: WWDC Overview

NOTIFICATIONS

UNNotificationServiceExtension

> Runs in background> Modify or replace the notification’s payload

> Download content> Decrypt notification

Page 65: WWDC Overview

NOTIFICATIONS

User Notification UI Framework

Page 66: WWDC Overview
Page 67: WWDC Overview
Page 68: WWDC Overview

RECOMMENDED TALKS

> Understanding Swift Performance> Server-Side Swift

> Swift API Design Guidelines> Optimizing App Startup Time

> Thread Sanitizer and Static Analysis> Debugging Tips and Tricks

> Concurrent programming with GCD

Page 69: WWDC Overview

THANKS!