
WWDC 2020 Session Notes
Thank You 🎉
Last years WWDC Session Notes was so successful that I decided to continue this form of WWDC session summary. I would like to take the moment to thank all of you for contribution, feedback, support and reading my session notes 🙏
Intro
Usually it is much faster to read through some bullet points instead of watching a 50 min session video. Then if you find something interesting you can still watch it.
Sessions that are exceptionally mentionable are highlighted using a ★.
This is work in progress since it is a lot of effort to watch all the videos by myself. So either please be patient or just open up an issue to make a suggestion which session notes you like to see next :)
Contribution
Feel free to submit a PR if I got something wrong or you have a suggestion for improvement. Please also have a look in CONTRIBUTING.md if you want to contribute.
Thanks so much to EVERYBODY who contributed and improved the overall quality of the notes and those who added complete notes to the list.
Mentions
This repo has already been mentioned many times on Twitter and apart from this also in the following places:
Table of Contents

- (TO-DO) Expanding automation with the App Store Connect API
- (TO-DO) What’s new in assessment
- Introducing Car Keys
- (TO-DO) Optimize the Core Image pipeline for your video app
- (TO-DO) Edit and play back HDR video with AVFoundation
- (TO-DO) Export HDR media in your app with AVFoundation
- (TO-DO) Author fragmented MPEG-4 content with AVAssetWriter
- (TO-DO) Discover ray tracing with Metal
- (TO-DO) Get to know Metal function pointers
- (TO-DO) Core Data: Sundries and maxims
- (TO-DO) App accessibility for Switch Control
- (TO-DO) Make your app visually accessible
- (TO-DO) Build Metal-based Core Image kernels with Xcode
- (TO-DO) Create a seamless speech experience in your apps
- Lists in UICollectionView
- Modern cell configuration
- Meet WidgetKit
- (TO-DO) Stacks, Grids, and Outlines in SwiftUI
- (TO-DO) Build SwiftUI views for widgets
- (TO-DO) Widgets Code-along, part 1: The adventure begins
- (TO-DO) Widgets Code-along, part 2: Alternate timelines
- (TO-DO) Widgets Code-along, part 3: Advancing timelines
- (TO-DO) App essentials in SwiftUI
- (TO-DO) Build document-based apps in SwiftUI
- Data Essentials in SwiftUI
- What’s new in SwiftUI
- (TO-DO) Build SwiftUI apps for tvOS
- (TO-DO) Build an Action Classifier with Create ML
- (TO-DO) Advances in diffable data sources
- (TO-DO) Create complications for Apple Watch
- (TO-DO) Enable encrypted DNS
- (TO-DO) Build complications in SwiftUI
- (TO-DO) Keep your complications up to date
- Build with iOS pickers, menus and actions
- (TO-DO) Optimize the interface of your Mac Catalyst app
- (TO-DO) Identify trends with the Power and Performance API
- (TO-DO) Design high quality Siri media interactions
- (TO-DO) Expand your SiriKit Media Intents to more platforms
- (TO-DO) Background execution demystified
- (TO-DO) What’s new in SiriKit and Shortcuts
- (TO-DO) Evaluate and optimize voice interaction for your app
- (TO-DO) Empower your intents
- (TO-DO) Decipher and deal with common Siri errors
- (TO-DO) Diagnose performance issues with the Xcode Organizer
- Eliminate animation hitches with XCTest
- Why is my app getting killed?
- (TO-DO) What’s new in MetricKit
- (TO-DO) Integrate your app with Wind Down
- (TO-DO) Feature your actions in the Shortcuts app
- Design for intelligence: Apps, evolved
- (TO-DO) Design for intelligence: Make friends with “The System”
- Design for intelligence: Discover new opportunities
- (TO-DO) Discover Core Image debugging techniques
- (TO-DO) Decode ProRes with AVFoundation and VideoToolbox
- (TO-DO) Write tests to fail
- (TO-DO) Build for the iPadOS pointer
- (TO-DO) Handle trackpad and mouse input
- (TO-DO) The Push Notifications primer
- (TO-DO) Explore Packages and Projects with Xcode Playgrounds
- Advances in UICollectionView
- What’s new in Universal Links
- (TO-DO) Explore the Action & Vision app
- Keynote ★
- (TO-DO) Meet Watch Face Sharing
- (TO-DO) Design great widgets
- (TO-DO) Adopt the new look of macOS
- (TO-DO) Build for iPad
- (TO-DO) Meet Scribble for iPad
- (TO-DO) What’s new in PencilKit
- (TO-DO) Support hardware keyboards in your app
- (TO-DO) Support local network privacy in your app
- (TO-DO) Boost performance and security with modern networking
- (TO-DO) Build local push connectivity for restricted networks
- (TO-DO) iPad and iPhone apps on Apple Silicon Macs
- (TO-DO) AutoFill everywhere
- (TO-DO) VoiceOver efficiency with custom rotors
- (TO-DO) Accessibility design for Mac Catalyst
- (TO-DO) Create app clips for other businesses
- (TO-DO) Introduction to SwiftUI
- Streamline your app clip
- (TO-DO) Discover AppleSeed for IT and Managed Software Updates
- (TO-DO) Leverage enterprise identity and authentication
- (TO-DO) Build location-aware enterprise apps
- (TO-DO) Build scalable enterprise app suites
- (TO-DO) What’s new in Mac Catalyst
- (TO-DO) Design for Game Center
- Configure and link your app clips
- Distribute binary frameworks as Swift packages
- (TO-DO) Inspect, modify, and construct PencilKit drawings
- (TO-DO) Structure your app for SwiftUI previews
- (TO-DO) What’s new in CareKit
- (TO-DO) Use model deployment and security with Core ML
- (TO-DO) Get models on device using Core ML Converters
- (TO-DO) Control training in Create ML with Swift
- (TO-DO) Deliver a better HLS audio experience
- (TO-DO) Build an Endpoint Security app
- (TO-DO) Formatters: Make data human-friendly
- Design for location privacy
- (TO-DO) Advancements in the Objective-C runtime
- XCTSkip your tests
- Embrace Swift type inference
- (TO-DO) Safely manage pointers in Swift
- (TO-DO) Explore logging in Swift
- (TO-DO) Swift packages: Resources and localization
- What’s new in Swift
- (TO-DO) What’s new in watchOS design
- (TO-DO) Design great app clips
- (TO-DO) Get the most out of Sign in with Apple
- Explore app clips
- (TO-DO) The details of UI typography
- (TO-DO) Master Picture in Picture on tvOS
- What’s new in HealthKit
- (TO-DO) Synchronize health data with HealthKit
- (TO-DO) Visually edit SwiftUI views
- (TO-DO) Discover WKWebView enhancements
- (TO-DO) Secure your app: threat modeling and anti-patterns
- (TO-DO) Create quick interactions with Shortcuts on watchOS
- (TO-DO) Add configuration and intelligence to your widgets
- (TO-DO) Broaden your reach with Siri Event Suggestions
- Platform State of the Union ★
- (TO-DO) Design for intelligence: Meet people where they are
- (TO-DO) Create great enterprise apps: A chat with Box’s Aaron Levie
- (TO-DO) Design with iOS pickers, menus and actions
- (TO-DO) Design for iPad
- (TO-DO) SF Symbols 2
- (TO-DO) What’s new in Core NFC
- (TO-DO) Modernize PCI and SCSI drivers with DriverKit
- (TO-DO) Port your Mac app to Apple Silicon
- (TO-DO) What’s new in ResearchKit
- (TO-DO) Explore numerical computing in Swift
- (TO-DO) Build localization-friendly layouts using Xcode
- (TO-DO) Handle interruptions and alerts in UI tests
- Get your test results faster
- (TO-DO) Create custom apps for employees
- (TO-DO) Deploy Apple devices using zero-touch
- (TO-DO) Meet Audio Workgroups
- (TO-DO) Improve stream authoring with HLS Tools
- (TO-DO) Record stereo audio with AVAudioSession
- What’s new in Low-Latency HLS
- (TO-DO) Discover HLS Blocking Preload Hints
- (TO-DO) Optimize live streams with HLS Playlist Delta Updates
- (TO-DO) Reduce latency with HLS Blocking Playlist Reload
- (TO-DO) Adapt ad insertion to Low-Latency HLS
- (TO-DO) The artist’s AR toolkit
- (TO-DO) Harness Apple GPUs with Metal
- (TO-DO) Optimize Metal apps and games with GPU counters
- (TO-DO) Shop online with AR Quick Look
- (TO-DO) Gain insights into your Metal app with Xcode 12
- Explore ARKit 4
- (TO-DO) What’s new in RealityKit
- (TO-DO) What’s new in USD
- (TO-DO) Advancements in Game Controllers
- (TO-DO) Build GPU binaries with Metal
- (TO-DO) Debug GPU-side errors in Metal
- (TO-DO) Bring keyboard and mouse gaming to iPad
- (TO-DO) Tap into Game Center: Dashboard, Access Point, and Profile
- (TO-DO) Tap into Game Center: Leaderboards, Achievements, and Multiplayer
- (TO-DO) Support performance-intensive apps and games
- (TO-DO) Bring your Metal app to Apple Silicon Macs
- (TO-DO) Optimize Metal Performance for Apple Silicon Macs
- (TO-DO) Capture and stream apps on the Mac with ReplayKit
- (TO-DO) Discover search suggestions for Apple TV
- Accelerate your app with CarPlay
- (TO-DO) What’s new in streaming audio for Apple Watch
- (TO-DO) What’s new in managing Apple devices
- (TO-DO) Design for the iPadOS pointer
- (TO-DO) Handle the Limited Photos Library in your app
- (TO-DO) Build Image and Video Style Transfer models in Create ML
- (TO-DO) Build a SwiftUI view in Swift Playgrounds
- (TO-DO) Use Swift on AWS Lambda with Xcode
- (TO-DO) Support multiple users in your tvOS app
- (TO-DO) What’s new in Web Inspector
- (TO-DO) Become a Simulator expert
- (TO-DO) Unsafe Swift
- (TO-DO) Add custom views and modifiers to the Xcode Library
- (TO-DO) Sync a Core Data store with the CloudKit public database
- What’s new in App Store Connect
- Meet the new Photos picker
- (TO-DO) Detect Body and Hand Pose with Vision
- (TO-DO) Create Swift Playgrounds content for iPad and Mac
- (TO-DO) Discover how to download and play HLS offline
- (TO-DO) Beyond counting steps
- (TO-DO) Make apps smarter with Natural Language
- (TO-DO) What’s new in education
- (TO-DO) Introducing StoreKit Testing in Xcode
- (TO-DO) What’s new in location
- (TO-DO) What’s new with in-app purchase
- What’s new in Wallet and Apple Pay
- (TO-DO) What’s new for web developers
- (TO-DO) Getting started with HealthKit
- (TO-DO) Meet Safari Web Extensions
- (TO-DO) One-tap account security upgrades
- (TO-DO) Custom app distribution with Apple Business Manager
- (TO-DO) Meet Nearby Interaction
- (TO-DO) Handling FHIR without getting burned
- (TO-DO) Meet Face ID and Touch ID for the web
- (TO-DO) Architecting for subscriptions
- (TO-DO) What’s new in ClassKit
- (TO-DO) Explore Computer Vision APIs
- (TO-DO) Build trust through better privacy
- (TO-DO) Build customized ML models with the Metal Performance Shaders Graph
- (TO-DO) Refine Objective-C frameworks for Swift
- (TO-DO) Explore the new system architecture of Apple Silicon Macs
- (TO-DO) Triage test failures with XCTIssue
Expanding automation with the App Store Connect API
https://developer.apple.com/wwdc20/10004
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
What’s new in assessment
https://developer.apple.com/wwdc20/10005
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Introducing Car Keys
https://developer.apple.com/wwdc20/10006
Presenter: Matthias Lerch
- People can unlock, lock and start their car (iPhone or Apple Watch)
- Stored securely on the device and can be deleted via iCloud
- Keys can be shared with the family or friends
- Agnostic to radio technology (supports NFC so far)
- Offline capable
- Car needs to support:
- Owner pairing (association if iPhone and car)
- Prove ownership of car
- Initiate pairing
- Place iPhone near car’s NFC reader
- Car key appears in Wallet
- Transactions (unlock, lock, start the car)
- NFC readers in door handle and dashboard (engine start)
- Optimized for security and performance
- Express mode lets the feature work without Face ID or passcode (turned on by default)
- iPhone and car can be offline
- Apple doesn’t know when you use your car
- Server Interfaces (key sharing, key management)
- Share keys over Messages
- Car can be offline when sharing
- Apple doesn’t know who you share your car key with
- Optional access levels (e.g. ‘Unlock and Drive’, ‘Access and drive up to 65 mph’)
- It’s up to each auto maker to define access levels
- Key management
- Manage owner and shared keys from iPhone or car
- Keys removed from a device stop working immediately (even if the device is offline)
- Easy to change owner device (e.g. when buying a new iPhone)
- System architecture
- Fully integrated into iOS natively
- Keys created and stored in Secure Elements and never exported
- All features use AES and eliptic-curve cryptography
- Offline design based on PKI
- Automaker TSM (Trusted Service Manager) not required for simple server integration
- What is a digital car key?
- Binded to the user’s device and not to Apple or auto makers
- Private key (SK) never leaves SE (Secure Element)
- Public key is exported in an X.509 certificate for verification
- Applet
- Implements the car key in the Secure Element
- Stores key pair, car public key, secure mailboxes
- All car keys hosted in a single applet instance
- Owner pairing flow (online)
- PAKE Verifier
- Pairing password
- Pairing
- Cryptographic linking
- Key activation/registration
- Key attestation
- Key sharing flow
- Owner sends invitation using Messages
- New key crated in
- Identity certificate chain
- Owner verification
- Attestation returned
- Offline registration
- Lifecycle of a car key
- Created during owner pairing or key sharing
- Transactions
- Suspensions
- Revocation
- Deletion
- Certificates and Transaction
- Owner sharing, key sharing, fast and standard transactions
- Take a deeper look at the presented flows and schemes at 11:30
- Radio technologies
- NFC
- Based on standard NFC reader
- Enhanced Contactless Protocol (ECP)
- Enables a fully automatic NFC experience
- Identifiers available before transaction starts (Reader type, Automaker)
- Efficient reader polling
- Ultra Wideband
- iPhone with U1 chip
- Use with iPhone in bag or pocket
- Common key management architecture
- Specification is currently in development
- Server integration
- Required for remote key management
- Auto maker server needs to establish connection to Apple’s backend (for each environment, e.g. testing and production)
- Exchange certificates
- Implement and test server interfaces (register a new key, revoke keys, send notifications)
- Provide artwork
- Connect to automaker app
- Automaker apps
- Provide custom features using keys stored in Wallet
- Start owner pairing
- Available to automakers
- Entitlement is required
- Use PassKit APIs
- How to get started (for auto makers)
- Car Connectivity Consortium
- Digital Key Specification 2.0
- Digital Key Specification 3.0 (in development, will support Ultra Wideband)
- carconnectivity.org
- Entroll to Apple MFi Program
Optimize the Core Image pipeline for your video app
https://developer.apple.com/wwdc20/10008
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Edit and play back HDR video with AVFoundation
https://developer.apple.com/wwdc20/10009
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10010
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Author fragmented MPEG-4 content with AVAssetWriter
https://developer.apple.com/wwdc20/10011
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10012
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10013
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Core Data: Sundries and maxims
https://developer.apple.com/wwdc20/10017
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
App accessibility for Switch Control
https://developer.apple.com/wwdc20/10019
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Make your app visually accessible
https://developer.apple.com/wwdc20/10020
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10021
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Create a seamless speech experience in your apps
https://developer.apple.com/wwdc20/10022
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Lists in UICollectionView
https://developer.apple.com/wwdc20/10026
Presenters: Michael Ochs
- Lists in iOS 14 Collection Views present
UITableView-like appearances in UICollectionView
- Improved self-sizing support: now default when using lists in
UICollectionView
- Build cells with AutoLayout and let collection view take over
- Override
preferredLayoutAttributesFittingAttributes: on cell subclasses to exercise manual sizing
- UICollectionLayoutListConfiguration
- The only new type required on the layout side to build lists in collection view
- Built on top of
NSCollectionLayoutSection and UICollectionViewCompositionalLayout: check out Advances in Collection View Layout
- Adds two list-exclusive styles:
.sidebar and .sidebarPlain for building multicolumn apps on iPadOS 14
- Options to show/hide separators and configure list headers/footers
- Creating lists
- Easy way
- Create a
UICollectionLayoutListConfiguration
- Create a
UICollectionViewCompositionalLayout with the configuration
- Per-section setup
- Create a
UICollectionLayoutListConfiguration
- Create a
NSCollectionLayoutSection with the configuration
- Place the above code inside existing section provider initializer on compositional layout
- Customize the layout on a per section basis
- Configuring list section headers/footers
- List headers/footers have to be explicitly enabled
- Register headers/footers as supplementary views
- Set header/footer configuration mode to ‘supplementary’
- Provide a supplementary view when rendering the header/footer on screen
- Set
headerMode to firstItemInSection (headers-only)
- Configure the first collection view cell to look like a header
- Recommended for hierarchical data structures and snapshot APIs: check out Advances in Diffable Data Source
- Data source need to be aware of first cell being header
- UICollectionViewListCell
- Subclass of
UICollectionViewCell, can be used interchangeably
- Better support to configure separator insets and cell content indentations
- Features Swipe Actions
- Better accessories API
- Granted access to default system content/background configurations: check out Modern Cell Configuration
- Separator Layout Guide
- Separators are supposed to line up with primary cell content
- Constrain this layout guide to the content: opposite of UIKit layout guides
- Configure the cell’s layout
- Constrain the separator layout guide’s leading anchor to cell’s primary content’s leading anchor
- Automatically handled when using system provided content configurations
- Swipe Actions
- Only supported if the cell is rendered inside sections configured using a list configuration
- Override the leading/trailing swipe action’s configuration getter to configure
- Caution: never capture the index path (unstable) of the cell being configured in action handler
- Directly capture the data model
- Capture a stable identifier of the cell:
- Diffable Data Source and its stable item identifier
- The new cell registration type in iOS 14: UICollectionViewListCell
- Accessories API of list cells
- Options to configure both leading and trailing side of the cell
- Configure multiple accessories on the same side
- Functionalities on list cell accessories
- Re-ordering accessory: cell is automatically in re-rodering mode when tapped
- Delete accessory: cell automatically reveals configured trailing swipe actions when tapped
- Outline disclosure accessory
- Cell automatically communicate with the data source and expand/collapse its children when tapped
- Requires the new section snapshot APIs: check out Advances in Diffable Data Source
- Plenty of system defaults are provided while customizabilities are kept
Modern cell configuration
https://developer.apple.com/wwdc20/10027
Presenter: Tylor Fox
- Getting started with configurations
- In iOS 13, we use the built-in imageView and textLabel properties on
UITableViewCell to display an image and some text.
- In iOS 14, we use the content configuration to describe the cell appearance for a specific state
- This is how you configure a cell using a content configuration:
var content = cell.defaultContentConfiguration() This always returns a fresh configuration without any content set on it. Don’t need to think about the old state at all.
- Set the image and text on the content configuration.
cell.contentConfiguration = content As soon as we call this, the cell is updated to display the image and text that we specified.
- Same code to configure any cell and any view that supports content configurations.
- Composable, lightweight, very inexpensive to create and built for performance
- Configuration types
- Background Configuration
- let you set things such as background color, visual effect, stroke, insets, corner radius and custom view
- List Content Configuration
- let you set things such as image, text, secondary text, layout metrics and behaviors
- Configuration state
- Configuration state represents the various inputs that you use to configure your cells and views.
- Each cell, header and footer has its own configuration state.
- Two Types
- View configuration state
- Trait collection
- 4 states: highlighted, selected, disabled and focused
- Custom state: this is key-value storage to add any extra states or data that use to configuring your view.
- Cell configuration state
- Everything from the View configuration state
- Editing, swiped, expanded
- Drag and drop states
- When
automaticallyUpdatesContentConfiguration is true, The cell automatically calls updated(for:) on its contentConfiguration when the cell’s configurationState changes, and applies the updated configuration back to the cell. The default value is true.
- When
automaticallyUpdatesBackgroundConfiguration is true, the cell automatically calls updated(for:) on its backgroundConfiguration when the cell’s configurationState changes, and applies the updated configuration back to the cell. The default value is true.
- You can override
updateConfiguration(using:) to manually update and customize the content configuration, disable automatic updates by setting this property to false. This method is called before your cell first displays and will be called anytime the configuration state have changed.
https://developer.apple.com/wwdc20/10028
Presenters: Nahir Khan, Neil Desai
- Widgets are now used across all platforms
- Great widgets are glancable, relevant and personalized
- Smart stacks are collections of widgets and automatically show the right one on top using on-device intelligence
- Widgets support configuration by tapping them - this is realized using intents similar to SiriKit
- e.g. choosing the city in a Weather app
- UI built entirely in SwiftUI
- How WidgetKit works
- WidgetKit extensions are background extensions
- They return a series of view hierarchies in a time line
- Time line is sent to the home screen which presents the right view at the right time
- Since views are “ready” they can be re-used at different points in the system, e.g. the Widget Gallery
- Time line is refreshed from main app and updates are scheduled by extension
- Imagine the Calendar time line for the day. One event is updated from Calendar, which then wakes up the extension and provides the new time line.
- Building a Widget
- Single Widget Extension supports multiple kinds of widgets on different platforms
- Possible configurations:
Static (Workout widget) or Intent-Based (Reminder widget that can be personalized)
- Supported Families: A widget can enable one or many of the following families:
systemSmall, systemMedium, systemLarge
- Widget struct must conform to
Widget and its body to WidgetConfiguration
- How to build a glancable experience
- Widgets are not mini apps they rather project content on the home screen
- No scrolling
- No videos or animated images
- Tap interactions to deep link into main app. Widget associable with a URL link using the widgetURL API (use the new Link API of SwiftUI)
- Important new view types:
Placeholder
- Should not contain user data
- Great placeholder UIs show a representation of what kind your data is
Snapshot
- Represent a single entry in time
- Should return a view as quickly as possible
- Used to display your widget in the gallery
- Use it as the first entry in your time line so users get what they see in the gallery
Time line
- Combination of views and dates
- Output if WidgetKit extension is serialized to disk which enabled rendering of individual entries just in time
- Reloads
- Wake up the extension and ask for a new time line
- Help to ensure that content is up to date
- Get a
TimelineProvider by struct Provider: TimelineProvider
- Implement
func snapshot(...) and func timeline(...) for returning the respective data
- Provide a reload policy at Time line cretion time to tell when the time line should be reloaded:
atEnd, after(date: Date), never
- System determines the best time to reload the widget, e.g. based on:
- Background notification
- Significant time change
- Changes in the app made by the user, e.g. new Calendar entry
- Use
WidgetCenter.[reloadTimelines(ofKind:), reloadAllTimelined] to programmatically reload time lines
- Get current configurations with
WidgetCenter.getCurrentConfigurations(completion:)
- Use batch requests
- Do not overuse networking from a widget
- Use
onBackgroundURLSessionEvents modifier to launch a network task which delivers the result to your extension
- Reloads are budgeted by the system, do not overuse them
- Personalization
- Use the
Intents framework, known from Siri, to customize the widgets behavior
- Use the new In-App Intent Handling to answer requests from your widget
IntentConfiguration is used to power intent-based widget configurations
IntentTimelineProvider is used to generate specific time lines
- Intelligence
- Widgets are displayed on the home screen by on-device intelligence
- Your app can donate shortcuts
- Widget extension can annotate time line entries using
TimelineEntryRelevance with its score and duration properties
Stacks, Grids, and Outlines in SwiftUI
https://developer.apple.com/wwdc20/10031
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10033
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10034
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10035
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10036
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
App essentials in SwiftUI
https://developer.apple.com/wwdc20/10037
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Build document-based apps in SwiftUI
https://developer.apple.com/wwdc20/10039
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Data Essentials in SwiftUI
https://developer.apple.com/wwdc20/10040
Presenters: Curt Clifton, Luca Bernardi, Raj Ramamurthy
- Getting Started
- Always ask you the following questions:
- What data does my view need?
- How will the view manipulate this date?
- Where will the data come from?
- Immutable views, that just display data, contain only let properties
- Pull multiple properties in their own config object
- The config object can contain functions to mutate its state
- Using
@State private var config: ConfigObject() to re-render your view after config changed
- Let parent and sub views communicate over a single config object by sharing it using
@Binding var config
- Pass
config down by marking the it as reference using the dollar symbol: SubView(config: $config)
- Modeling Data Using ObservableObject
- Class-constrained protocol (only adoptable by reference types)
- Can be used to achieve super-custom behaviors, e.g. backing data by a service or server
- Conform by implementing
var objectWillChange: Self.ObjectWillChangePublisher { get }
- Use to manage data life cycle, handle side-effects, integrate with existing components
- Will be your source of truth
- Doesn’t need to be your full data model - split into multiple observable objects if your model is complex
- Use a single ObservableObject for all your views if your data model is simple
- Mark properties of your ObservableObject, your view is interested in as
@Published var progress: Double
- How to create an ObservableObject dependency?
@ObservedObject
@ObservedObject var config: Configuration
- You need to manage the objects ownership outside of your view
- Create a binding to any value-type property of the ObservableObject to pass it into e.g.
$config.isFinished a Toggle control and let it automatically update your view
@StateObject
- SwiftUI owns the ObservableObject
- Creation/destruction is tied to view’s life cycle
- Instantiated just before body runs
- Use it to implement e.g. an
ImageLoader: ObservableObject with a @published var image: Image property
- Whenever
@StateObject changes the view is re-rendered and thus populated with the image
EnvironmentObject
- In SwiftUI you typically have a hierarchy of many modular sub views
- To avoid a lot of boilerplate by passing around ObservableObject’s pass it to
.environmentObject(...) on your root view
- Changes to it, from any view in the hierarchy, will be reflected in any other view
- SwiftUI Performance Considerations
- Avoid slow view updates
- Make view initializers cheap, e.g. no dispatches
- Make body a pure function
- Avoid assumptions
- New event sources:
onChange, onOpenURL, onContinueUserActivity - run on main thread
- Who owns the data?
- Share data in a common ancestor
- Leverage
@StateObject
- Consider placing global data in
App and pass it down the view hierarchy. Changes to it will re-render all scenes (instances/windows) of your app
- New 2020: Property Wrappers that offer data persistence across app restarts and can be used as source of truth
@SceneStorage
- Per-scene property wrapper for reading/writing data managed by SwiftUI
- Light-weight storage for your views data
- Use it to populate your collection views
@AppStorage
- App-scoped global storage, persisted using
UserDefaults, usable anywhere (app/view)
- Perfect for storing settings
@AppStorage("amountOfGold") private var amountOfGold = 5000
- Automatically reads/writes from/to UserDefaults whenever the property changes
What’s new in SwiftUI
https://developer.apple.com/wwdc20/10041
Presenters: Matt Ricketson, Taylor Kelly
- Apps
- Bild your whole app using SwiftUI:
struct BookClubApp: App
- Apps can declare data dependencies
- Use
WindowGroup to manage windows platform independent. Supports multiple windows on macOS and iPadOS out of the bos
- Use
Settings to get a preference pane for free • available on macOS
- Use
DocumentGroup scene type to automatically handle opening, saving and editing documents • macOS, iOS, iPadOS
- Use
CommandMenu command to add additional menus to the menu bar including keyboard shortcuts
- New multi-platform templates specifically for SwiftUI apps
LaunchScreen Info.plist key to configure your launch screen • simple alternative to the storyboard
- Widgets
- iOS, iPadOS, macOS exclusively built using SwiftUI
- Declared by
struct YourWidget: Widget and var body: some WidgetConfiguration
- Use SwiftUI to build custom complications for watchOS
- Lists and Collections
- List now receive outlines to quickly access the lists content • reduces the need for push/pop navigation patterns
- Lazy loading grid layouts (
Lazy[V|H]Stack) to reduce memory footprint and preserve smooth scrolling for large amounts of data
- View Builder for switch statements to show e.g. different image styles in a list of images
- Toolbars and Controls
.toolbar modifier for unified display of toolbars
- Use
ToolbarItem(placement: .principal) to make an item prominent
- Use
ToolbarItem(placement: .bottomBar) to place an item in the bottom bar
- When using
Label("Title", systemImage: "sf.symbol.name") SwiftUI automatically display icon and/or text depending on where the label is displayed: toolbar, list, …
.keyboardShortcut modifier can now be used for additional controls like Button
- New default focus support in tvOS
- New controls:
ProgressView("Downloading", value: progress) - horizontal bar
ProgressView("Downloading", value: progress).progressViewStyle(CircularViewStyle()) - circular progress indicator
ProgressView() - spinner
Gauge to indicate the level of value • can contain value labels and min/max value labels
- New effects and styling
- New control center UI with beautiful transitions
.matchedGeometryEffect to provide smooth animations inside of a grid of UI elements
.clipShape(ContainerRelativeShape()) to automatically apply a super views shape to the subview
- custom fonts automatically scaled with dynamic type changes
- Custom accent color directly form the AssetCatalog on all platforms
- Many controls can now be tinted
- System integration
- New
Link control to display URLs in link style and open them with the default browser • also supports url schemes to open other apps
@Environment(\.openURL) private var openURL to programmatically open urls via openURL(url) in your views
onDrag {} and onDrop {} to support drag & drop
UniformTypeIdentifers framework for e.g. introspection of file types
Sign in with Apple as first class component in SwiftUI • available on every platform
- Other Frameworks: AuthenticationServices, AVKit, MapKit, SceneKit, SpriteKit
Build SwiftUI apps for tvOS
https://developer.apple.com/wwdc20/10042
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Build an Action Classifier with Create ML
https://developer.apple.com/wwdc20/10043
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Advances in diffable data sources
https://developer.apple.com/wwdc20/10045
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Create complications for Apple Watch
https://developer.apple.com/wwdc20/10046
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Enable encrypted DNS
https://developer.apple.com/wwdc20/10047
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Build complications in SwiftUI
https://developer.apple.com/wwdc20/10048
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Keep your complications up to date
https://developer.apple.com/wwdc20/10049
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Build with iOS pickers, menus and actions
https://developer.apple.com/wwdc20/10052
Presenters: Eric Dudiac, David Duncan
- UISlider and UIProgressView: More consistent across platforms now
- UIActivityIndicatorView: New simpler design, Use color API and modern styles, Updates “pull-to-refresh”
- UIPickerView: Updated styling
- UIPageControl
- New interactions (scrubbing, scrolling)
- Unlimited pages
- Optional custom indicator icons:
.preferredIndicatorImage(UIImage()) to set all or .setIndicatorImage(UIImage(), forPage: 0) for a specific image
- Multiple styles:
.backgroundStyle = .prominent to highlight the background
- UIColorPickerViewController
- New view controller for picking colors
- Eyedropper, Favorites, Hex specification
- UIDatePicker
- New compact style to select date and time
- In-line style on iOS - great for iPad or if date picking is primary UI (matches modal presentation)
- Useful when you have space constraints
- Full modal calendar when selecting dates
- Keyboard for selecting times
- New macOS style (10.15.4)
- Compact, modal calendar presentation
- Supported in Catalyst apps
- Menus
- Provided on
UIControl
- Directly supported by UIButton and UIBarButtonItem by
button.menu = UIMenu(...)
- Triggered via long-press by default
- Show the menu by a simple tap by setting
button.showsMenuAsPrimaryAction = true and don’t provide a primary action
- Back buttons implement menus to quickly jump back in navigation stack
- Take action when the menu action is recognized, register for
UIControl.Event.menuActionTriggered
UIDeferredMenuElement to async provide menu items
UIContextMenuInteraction to modify or replace provided menu updateVisibleMenu(_ block menu: (UIMenu) -> UIMenu)
- Use
UIContextMenuInteraction.rich to display previews and .compact to only show a menu
- New
UIBarButtonItem initializers init(systemItem:primaryAction:menu:), init(title:image:primaryAction:menu:)
- New
UIBarButtonItem .fixedSpace() and .flexibleSpace
UIButton can finally be initialized using an UIAction: init(type:primaryAction:) -> native block based API
UISegmentedControls can now finally be initialized using UIActions -> native block based API
Optimize the interface of your Mac Catalyst app
https://developer.apple.com/wwdc20/10056
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10057
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10060
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10061
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Background execution demystified
https://developer.apple.com/wwdc20/10063
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
What’s new in SiriKit and Shortcuts
https://developer.apple.com/wwdc20/10068
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Evaluate and optimize voice interaction for your app
https://developer.apple.com/wwdc20/10071
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Empower your intents
https://developer.apple.com/wwdc20/10073
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Decipher and deal with common Siri errors
https://developer.apple.com/wwdc20/10074
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
https://developer.apple.com/wwdc20/10076
Presenters: Example Guy, Another Person
TO-DO! You can contribute to this session, please see CONTRIBUTING.md
Eliminate animation hitches with XCTest
https://developer.apple.com/wwdc20/10077
Presenter: Tanuja Mohan
- Hitch: A frame appears on screen later than expected
- VSYNC: Time the screen swaps the frame onto the display
- Hitch time: Time in ms that a frame is late to display
- Hitch ratio: Hitch time in ms per second for a given duration
- Apple doesn’t use frames per second (fps) since:
- 60 or 120 fps is not always the desired target
- Display may intentionally not be updated
- Target frame rate may intentionally be lower than possible
- Hitch ratio is always comparable across tests, following ratios are recommended:
- Good: < 5ms/s
- Warning: 5…10ms/s - users will start recognizing hitches
- Critical: >10ms/s
- Can be measured using
XCTestMetrics and unit tests or for production apps using MetricsKit and Xcode Organizer
XCTOSSignpostMetric gives you the following when using an animation os_signpost interval:
- Duration
- Total count of hitches
- Total duration of hitches
- Hitch time ratio
- Frame rate
- Frame count
- Specify an animation os_signpost interval by:
os_signpost(.animationBegin, log: logHandle, name: "performanceAnimationInterval")
os_signpost(.end, log: logHandle, name: "performanceAnimationInterval")
- UIKit has pre-defined metrics:
XCTOSSignpostMetric.navigationTransitionMetric
XCTOSSignpostMetric.customNavigationTransitionMetric
XCTOSSignpostMetric.scrollDecelerationMetric
XCTOSSignpostMetric.scrollDraggingMetric
- Application state can be reset to avoid tests influencing themselves:
XCTMeasureOptions().invocationOptions = [.manualStop]
- Listen to a live testing session at 8:15
Why is my app getting killed?
https://developer.apple.com/wwdc20/10078
Presenter: Andy Aude
- Most common reasons why apps can be terminated in the background
- Crash
- Segmentation fault
- Illegal instruction
- Asserts and uncaught exceptions
- CPU resource limit
- High sustained CPU load in background
- Energy Exception Report
- Reports contain call stack points out hotspots in code
- Consider moving work into
BGProcessingTask
- Watchdog
- Long hang during key app transitions
application(_:didFinishLaunchingWithOptions:)
applicationDidEnterBackground(_:)
applicationWillEnterForeground(_:)
- These transitions have a time limit on the order of 20 seconds
- Terminations are disabled in Simulator and in the Debugger
- Eliminate deadlocks, infinite loops, synchronous work
- Report available via
MXCrashDiagnostic
- Memory limit exceeded
- App using too much memory
- Same limit for foreground and background
- Use Instruments and Memory Debugger
- Keep in mind older devices
- Memory pressure exit (jetsam)
- Not a bug with your app
- Most common termination
- System freeing up memory for active applications
- Reducing jetsame rate
- Aim for less than 50MB in background
- Upon background flush state to disk, clear out image views, drop caches
- Recovering from jetsame
- Save state upon entering background
- Adopt UIKit State Restoration
- User should not realize app was terminated
- Background task timeout
README 内容过长,已截取前 64 KB。完整内容请前往 GitHub 仓库查看。
评论