Notes WWDC 2019 : Implementing Dark Mode on iOS
Référence : Session 214 - Implementing Dark Mode on iOS
Dark Mode is a new look
- Colors: now semantic colors, secondary/tertiary variants to structure the visual appearance
- Materials (blur effects)
- Built-in views and controls
It’s easy to implement
- Dynamic colors: no need to update the view when style changes
- Can define custom dynamic colors and images in Assets Catalog
Flexible and powerful
UITraitCollection.userInterfaceStyle
(.dark
/.light
)- Can programmatically resolve a dynamic color with a trait collection, and create custom dynamic color with a block to resolve based on a trait collection instance
- Might need manual update, for instance when using
CGColor
- Keep in mind: not just one trait collection in your app
- Can override user interface style on a view controller or a view, or at app level in
Info.plist
- New status bar styles (default, dark and light)
- New
UIActivityIndicatorView
styles - For attributed string, need to specify foreground color
- Web content must opt-in to Dark Mode