Stage 2 · Lesson 9 of 10
SF Symbols, semantic colours and dark mode
SwiftUI supports for free if you use semantic colours, colours named for their job rather than their shade. Use .primary and .secondary for text and Color(.systemBackground) for backgrounds. For your brand colours, add colour sets in the with light and dark variants.
Set an accent colour once with .tint. are thousands of icons that match the system font, loaded with Image(systemName: "heart.fill"). They scale with , the user's text size setting, and support several rendering modes.
Check every screen in dark mode using the preview or the setting, and check contrast.
Common traphard-coded Color.white backgrounds and black text, which leave screens blinding or unreadable in dark mode.
A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- CourseFreeSwiftUI Tutorials (Apple)
Apple · Beginner
Apple's own path from views and stacks to lists and navigation
- CourseFree100 Days of SwiftUI
Paul Hudson (Hacking with Swift) · Beginner
Days 16 to 35 build six small apps on views, modifiers, lists and animation