A sleek, modern iOS application built with SwiftUI and MVVM architecture that demonstrates real-time, dynamic theme switching (System, Light, and Dark modes) with fluid spring animations and local persistence.
To keep the presentation clean and compact, the screenshots are presented side-by-side:
| ☀️ Light Mode | 🌙 Dark Mode |
|---|---|
![]() |
![]() |
This project is structured around key iOS development concepts, demonstrating clean code practices and dynamic UI logic.
| Technology / Pattern | Role in ThemeChanger |
|---|---|
| SwiftUI | Declarative user interface construction, modern layout containment, and state-driven styling. |
| MVVM Architecture | Complete separation of concern between UI components (Views/), state management logic (ViewModels/), and configurations (Models/). |
| Combine / ObservableObject | Reactive UI updates where views subscribe to changes in the central theme manager. |
@AppStorage |
Lightweight, native persistence used to save the user's selected theme across application sessions. |
matchedGeometryEffect |
Smooth capsule sliding transitions when switching between different theme options. |
| Dynamic Color Schemes | Responsive background shifts adapting directly to whether light or dark mode is selected. |
Below is the layout of the source files in the project workspace:
ThemeChanger/
├── Models/
│ └── Theme.swift # AppTheme enum defining titles, icons, and colors
├── ViewModels/
│ └── ThemeManager.swift # ObservableObject storing and publishing theme state
├── Views/
│ ├── ThemeButton.swift # Animated buttons with sliding capsule highlights
│ ├── ThemeCard.swift # Card container adapting shadow and background
│ ├── ThemePicker.swift # Custom styled horizontal slider selector
│ └── ThemeSelectionView.swift # Aggregated selection panel layout with dynamic icons
├── ThemeChangerApp.swift # Entry point injection of EnvironmentObject
└── ContentView.swift # Root view setting the preferred color scheme- Clone or download this repository.
- Open
ThemeChanger.xcodeprojin Xcode (v14.0+ recommended). - Select a target simulator (e.g., iPhone 15 or later).
- Press
Cmd + Rto run and interact with the theme changer.
ThemeChanger is both a portfolio project and a learning journey, built to showcase my skills in Swift, SwiftUI, & MVVM architecture.
Thank you for taking the time to explore my work. I hope this project reflects my passion for building high-quality iOS and SwiftUI applications and my commitment to continuous learning and improvement.
Thanks for visiting! 💖

