Skip to content

StewartLynch/ModeChanger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ModeChanger

ModeChanger demo

ModeChanger is a small SwiftUI sample app that demonstrates how to let a user choose the app's appearance mode and persist that choice across launches.

The app supports three appearance options:

  • System
  • Light
  • Dark

The selected mode is stored with @AppStorage and applied at the app entry point with preferredColorScheme.

Requirements

  • Xcode 26.4 or later
  • iOS 26.4 or later

Getting Started

  1. Open ModeChanger.xcodeproj in Xcode.
  2. Select an iOS simulator or device.
  3. Build and run the ModeChanger scheme.

Project Structure

  • ModeChangerApp.swift - App entry point that applies the saved appearance mode.
  • ContentView.swift - Main screen with navigation, modal presentation, and the appearance picker.
  • AppearanceMode.swift - Enum that defines the supported appearance modes, labels, icons, and color schemes.
  • NavigationStackView.swift - Example pushed view.
  • ModalSheetView.swift - Example modal sheet.

Notes

The appearance menu is shown in the bottom toolbar. Selecting a mode updates the app immediately and saves the preference for the next launch.

About

Sample project for demonstrating how to set the color scheme in a SwiftUI App

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages