Files
Nextcloud-Cookbook-iOS/Nextcloud Cookbook iOS Client/Nextcloud_Cookbook_iOS_ClientApp.swift
2025-05-31 11:12:14 +02:00

40 lines
1.1 KiB
Swift

//
// Nextcloud_Cookbook_iOS_ClientApp.swift
// Nextcloud Cookbook iOS Client
//
// Created by Vincent Meilinger on 06.09.23.
//
import SwiftUI
import SwiftData
@main
struct Nextcloud_Cookbook_iOS_ClientApp: App {
@AppStorage("onboarding") var onboarding = true
@AppStorage("language") var language = Locale.current.language.languageCode?.identifier ?? "en"
var body: some Scene {
WindowGroup {
ZStack {
if onboarding {
//OnboardingView()
EmptyView()
} else {
MainView()
.modelContainer(for: [Recipe.self, GroceryItem.self, RecipeGroceries.self])
}
}
.transition(.slide)
.environment(
\.locale,
.init(identifier: language ==
SupportedLanguage.DEVICE.rawValue ? (Locale.current.language.languageCode?.identifier ?? "en") : language)
)
.onAppear {
AuthManager.shared.loadAuthString() // Load the auth string as soon as possible
}
}
}
}