How zhrispineda/settings-ios works
Project type and purpose
• This is a single-page mobile application written in Swift/SwiftUI that fully simulates Apple’s Settings app for iOS and iPadOS.
• It has no back-end service or database; all data are in-memory within the app and resources (assets, localization files) shipped in the bundle.
File structure
• Top level
• Preferences.xcodeproj / workspace – Xcode project files and schemes
• Preferences folder – all source code and resources
• SettingsTests, SettingsTopLevelPanesRenderTests – UI and unit test targets
• Inside Preferences/
• PreferencesApp.swift & ContentView.swift – SwiftUI entry point and root view
• Models/SettingsModel.swift – the single source of truth (ViewModel)
• Components/ – utility classes (helper, logger, UIKitRepresentable bridge)
• Templates/ – reusable SwiftUI view primitives (custom labels, toggles, links)
• Views/ – feature-grouped SwiftUI view hierarchies (Main, Apps, Radios, Security, Services, etc.)
• Extensions/ – Swift and UIKit extensions to augment APIs
• Resources/ –
– Localization .xcstrings – all UI text in dozens of languages
– ReadMe HTML – documentation for iOS/iPadOS usage
• No server, local database, or external API folders are present – this is a front-end only app.
Extract insights from README
• The app simulates every Settings pane, sometimes loading real preference bundles via a UIKit bridge.
• It supports two display modes (physical and simulator); that toggle lives in SettingsModel.
• It’s a learning/personal project, so code is organized around reusability (Templates) and feature isolation (Views folders).
Main components & their relationships
a. App Entry
• PreferencesApp (App protocol)
→ instantiates SettingsModel (ObservableObject)
→ injects model into ContentView via @StateObject
b. Model Layer
• SettingsModel.swift holds app state (current device type, toggles, navigation)
c. View Layer
• ContentView.swift hosts root NavigationView/List
• Views/… subdirectories contain feature-specific navigation links and detail views
• Templates/ defines building blocks used across many views
d. Component Layer
• UIKitRepresentables.swift bridges UIKit PreferenceBundleViewControllers into SwiftUI
• SettingsLogger.swift handles analytics or debug logging
• MGHelper.swift general utilities
e. Resource Layer
• Localization provides all user-facing strings
f. Test Layer
• SettingsTests – unit tests for SettingsModel or logic
• SettingsTopLevelPanesRenderTests – snapshot/UI tests for main panes
Data flows:
• User taps a row in View → SwiftUI NavigationLink updates navigation state → SettingsModel updates if needed → new SwiftUI View loads (possibly wrapping a UIKit controller).
• Views read data (e.g. device type) from SettingsModel via @ObservedObject.
Architectural patterns & design principles
• MVVM-ish: SettingsModel as ViewModel, Views subscribe to it and update on @Published changes.
• Feature grouping: each major Settings section is isolated in its own folder.
• Reusability: Templates folder holds generic SwiftUI controls.
• UIKit bridging: a thin adapter layer (UIKitRepresentables) loads real preference bundles.
• Localization and asset catalogs follow Apple guidelines.