What do I need to do to make my SwiftUI view update correct on an always-on display?
Generated on 9/24/2024
1 search
To ensure your SwiftUI view updates correctly on an always-on display, especially for Apple Watch, you should consider the following:
-
Color Scheme and Luminance: When the watch is in always-on mode, the system automatically switches to a dark color scheme and reduces luminance. If your view has brightly colored elements, use the
isLuminanceReduced
environment value to adjust these elements by either removing them or reducing their brightness. This helps maintain readability. -
Semantic Colors: Utilize semantic colors like
primary
, which automatically adapt to the appropriate color scheme, ensuring your view looks good in both light and dark modes. -
Preferred Color Scheme: If you want your live activity to have a light appearance, set the preferred color scheme to light. The system will automatically use the dark appearance in always-on display mode with reduced luminance.
These adjustments help ensure that your SwiftUI view remains clear and readable on an always-on display, providing the best user experience.
For more detailed guidance, you can refer to the session Bring your Live Activity to Apple Watch (08:07).
Bring your Live Activity to Apple Watch
Bring Live Activities into the Smart Stack on Apple Watch with iOS 18 and watchOS 11. We’ll cover how Live Activities are presented on Apple Watch, as well as how you can enhance their presentation for the Smart Stack. We’ll also explore additional considerations to ensure Live Activities on Apple Watch always present up-to-date information.
Enhance your UI animations and transitions
Explore how to adopt the zoom transition in navigation and presentations to increase the sense of continuity in your app, and learn how to animate UIKit views with SwiftUI animations to make it easier to build animations that feel continuous.
SwiftUI essentials
Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.