Skip to Content
Swift SDKGuidesDark / Light Mode

Dark/Light Mode

The Vio Swift SDK provides complete dark/light mode support that adapts to iOS system settings.

Quick Start

Add to your vio-config.json:

{ "theme": { "mode": "automatic", "lightColors": { "primary": "#007AFF", "surface": "#FFFFFF", "textPrimary": "#000000" }, "darkColors": { "primary": "#0A84FF", "surface": "#1C1C1E", "textPrimary": "#FFFFFF" } } }

Theme Modes

ModeDescription
automaticAdapts to iOS system setting (recommended)
lightForce light theme
darkForce dark theme

Programmatic Updates

// Switch to dark mode VioConfiguration.updateTheme( VioTheme( name: "Dark Override", mode: .dark, lightColors: .vio, darkColors: .vioDark ) ) // Return to automatic VioConfiguration.updateTheme( VioTheme(name: "Auto", mode: .automatic, lightColors: .vio, darkColors: .vioDark) )

Auto-Generated Dark Colors

If you only specify lightColors, dark colors are generated automatically:

{ "theme": { "mode": "automatic", "lightColors": { "primary": "#FF6B35", "secondary": "#004E89" } } }
Last updated on