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:

  1. 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.

  2. 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.

  3. 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).