Files
Nextcloud-Cookbook-iOS/Nextcloud Cookbook iOS Client/Nextcloud_Cookbook_iOS_ClientApp.swift
Hendrik Hogertz 02118e3d7a Add dark mode support with appearance picker and fix hardcoded colors
Add user-facing appearance setting (System/Light/Dark) wired via
preferredColorScheme at the app root. Replace hardcoded .black tints
and foreground styles with .primary so toolbar buttons and text remain
visible in dark mode. Remove profile picture from settings and
SwiftSoup from acknowledgements.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-15 06:31:14 +01:00

45 lines
1.2 KiB
Swift

//
// Nextcloud_Cookbook_iOS_ClientApp.swift
// Nextcloud Cookbook iOS Client
//
// Created by Vincent Meilinger on 06.09.23.
//
import SwiftUI
import SwiftUI
@main
struct Nextcloud_Cookbook_iOS_ClientApp: App {
@AppStorage("onboarding") var onboarding = true
@AppStorage("language") var language = Locale.current.language.languageCode?.identifier ?? "en"
@AppStorage("appearanceMode") var appearanceMode = AppearanceMode.system.rawValue
var colorScheme: ColorScheme? {
switch appearanceMode {
case AppearanceMode.light.rawValue: return .light
case AppearanceMode.dark.rawValue: return .dark
default: return nil
}
}
var body: some Scene {
WindowGroup {
ZStack {
if onboarding {
OnboardingView()
} else {
MainView()
}
}
.preferredColorScheme(colorScheme)
.transition(.slide)
.environment(
\.locale,
.init(identifier: language ==
SupportedLanguage.DEVICE.rawValue ? (Locale.current.language.languageCode?.identifier ?? "en") : language)
)
}
}
}