Files
LabWiseiOS/LabWise/LabWiseApp.swift

35 lines
979 B
Swift
Raw Normal View History

2026-03-19 20:31:34 -05:00
import SwiftUI
import LabWiseKit
import UIKit
// Controls which orientations are allowed app-wide at runtime.
// SpreadsheetView flips this to .landscape; all other screens use .allButUpsideDown.
final class AppDelegate: NSObject, UIApplicationDelegate {
static var orientationLock: UIInterfaceOrientationMask = .allButUpsideDown
func application(
_ application: UIApplication,
supportedInterfaceOrientationsFor window: UIWindow?
) -> UIInterfaceOrientationMask {
AppDelegate.orientationLock
}
}
2026-03-19 20:31:34 -05:00
@main
struct LabWiseApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
@State private var appState = AppState.shared
2026-03-19 20:31:34 -05:00
var body: some Scene {
WindowGroup {
if appState.isAuthenticated {
DashboardView()
.environment(appState)
} else {
LoginView()
.environment(appState)
}
2026-03-19 20:31:34 -05:00
}
}
}