Adapting to Light & Dark Mode
Use semantic colors for both appearances.
Two Appearances
iOS offers Light and Dark Mode, and users switch any time. A polished app looks great in both without extra effort.
Use Semantic Colors
Reach for semantic colors like Color.primary or Color(.systemBackground). They flip automatically between appearances.
Text("Title")
.foregroundStyle(.primary)
.background(Color(.systemBackground))All lessons in this course
- VoiceOver & Accessibility Labels
- Dynamic Type & Scaled Fonts
- Localizing Strings & String Catalogs
- Adapting to Light & Dark Mode