WWDC 2018 Platforms State of the Union Recap

In the Platforms State of the Union at WWDC 2018, Apple discussed new and updated tools and frameworks for developers. You can read my notes from the talk below, or you can watch the video in the unofficial WWDC app for macOS or in the official WWDC app for iOS.

Privacy

Trust is crucial as technology becomes more and more integrated into our lives

  • Data minimization and use
  • On-device intelligence
  • Transparency and control

Alerts for requesting data

  • Explain how you’ll use the data
  • Be specific
  • Provide an example

Security

  • Data protection
  • App Transport Security
  • CloudKit is encrypted

Two-factor authentication

  • 2/3 of Apple IDs are protected by two-factor auth

Passwords:

  • making them more convenient

Automatic strong passwords:

  • iOS 12 makes them easy
  • Available in iOS apps and Safari
  • Need a domain

Users can ask Siri to see passwords

  • Password reuse auditing
  • Security code AutoFill
  • Password AutoFill extension

Tools (Instruments)

Apple provides tools to help create delightful experiences:

  • Static analyzer
  • Runtime Issues
  • Accessibility inspector
  • Runtime sanitizers
  • XCTest
  • Code Coverage
  • Instruments

Now you can add your own custom tools

New: os_signpost (builds on os_log)

Demo:

  • os_log(:)
  • os_signpost(.begin, log: name:) // or .end
  • Signposts appear in Instruments
  • Custom Instruments packages
  • you can install new templates in Instruments

macOS Mojave

Mojave is the last release to support 32-bit apps

User Consent

  • Location
  • Contacts
  • Photos
  • Calendar
  • Reminders
  • Camera (new)
  • Microphone (new)

Enhanced Runtime Protections

  • SIP protections for your apps
  • Strong code validation
  • Protection from debugging and code injection

Notarized Apps

  • Distributed outside Mac App Store
  • Extension to Developer ID program
  • Finer-grained revocation

Now you can:

  1. Build your app
  2. Submit to Developer ID Notary Service
  3. Distribute your normal way (outside App Store)

This is not app review

Available today in beta

macOS User Experience

Quick Actions

  • Shown in Finder
  • Such as PDF to PNG
  • Can use Automator to script
  • Show up in Touch Bar

UIKit apps on the Mac

  • Easy way to bring iOS apps to Mac
  • Not de-emphasizing Mac frameworks
  • UIKit apps run in a native environment
  • AppKit and UIKit will share Media, Core OS, and Core Services

Demo

  • Can resize, full screen, select text, and drag & drop
  • Share button uses Mac share sheet

Not ready yet — next year

Dark Mode

It’s beautiful

Adopting dark mode:

  • not automatically opting in: need to build for Mojave
  • simple API to enable dark mode: NSColor, visual effect view, etc.

Try it today. “For a few of our apps it was as little as a day of work.”

Xcode 10 and Dark Mode Demo

  • Xcode Asset Catalogs make it easy
  • Dark variants for colors
  • Bottom bar allows you to toggle between appearances
  • Change appearance while debugging (even if OS is in other mode)

Design Tools

  • NSGridView is great for forms. Now in Interface Builder
  • Drag and drop other views into grid view

Source Editing

  • Editor loads large documents much faster
  • SourceKit stability
  • Code completion and navigation are better
  • Jump to definition now includes file and line number

Swift Refactoring

Actions: built into Xcode now

Source Control Change Bar

Different colors for source control states in left sidebar:

  • Conflicts
  • Upstream
  • Unpushed
  • Uncommitted

Editor supports overscroll now

So the bottom line of your file can be in the middle of the screen

Code Folding

  • Fold anything you want
  • Click on folding ribbon to fold

Multi-cursor editing

  • Copy/paste multiple things at once
  • Hold option and multi-select to change a bunch of weak to unowned

Source control integration

  • Unified conflict resolution with git
  • Pull supports rebase now (no more merge commits!)
  • Add SSH keys for service accounts

Services:

  • GitHub (Xcode 9)
  • Bitbucket cloud (new in Xcode 10)
  • GitLab (new in Xcode 10)

Debugging

  • LLDB
  • 5x faster downloading debug symbols
  • enhanced memory debugging, new compact layout
  • Energy diagnostic reports (like crash logs but for energy)

Testing

New:

  • Include/exclude tests in bundles
  • Randomize order of test execution
  • Execute in parallel

Now Xcode can test on multiple simulators at once (by cloning the iPhone X simulator, for example)

Parallel testing

Go to Edit scheme, “execute in parallel”

Uses multiple processes for unit tests

  • 4x faster for this demo
  • Works great for unit tests and UI tests
  • Run all the same tests faster so you can add more of them

Build system

  • Faster rebuilds: up to 2x
  • Less memory: up to 20%
  • Debug build performance is often 2x as fast

Swift 4.2

try out new APIs in Xcode playgrounds: evaluate new lines of code without re-running playground

Swift 5

  • Binary compatibility
  • Swift in the OS, thinned on ap distro
  • Smaller downloads

Early next year

Machine Learning

  • Vision: face, shapes, barcode, pull person out and change background
  • Natural language: language detection, tokenization, parts of speech

CoreML 2

  • Smaller models
  • Support 8-bit to 1-bit quantization 17mb -> 5mb

Create ML

Easy to use training framework

Natural language

train model to understand if hotel or restaurant

Image classification

use transfer learning to start with Apple’s training and augment with your training

100MB down to 3MB

Train to detect a rose

  • Faster to train
  • Smaller model size

Algorithms

  • linear regression
  • logistic regression

Shortcuts

With Siri

Prediction on device

NSUserActivity

Handoff, Spotlight search

isEligibleForUserPrediction = true

Shortcuts with Intents

  • inline action in Siri
  • Custom Siri voice responses

Creating shortcuts

  • Define
  • Donate
  • Handle

User: “Hey Siri, Soccer roster”

Metal

  • more than 400,000 Metal apps
  • 1 billion Metal systems
  • Deprecating OpenGL, OpenGL ES, OpenCL in macOS Mojave, iOS 12, tvOS 12
  • Metal Dependency Viewer
  • Metal Shader Debugger

AR

  • iOS is world’s largest AR platform
  • AR now in Messages, News, Safari, and more
  • New USDZ file format
  • SwiftShot game: two-player slingshot AR game

ARKit 2

  • Improved face tracking
  • Environment texturing
  • Imaged detection and tracking
  • 3D object detection
  • Persistent experiences
  • Shared experiences

All available today for download