import SwiftUI @main struct gitbayApp: App { @State private var session = SessionStore() init() { GitbayFonts.register() } var body: some Scene { WindowGroup { ContentView() .environment(session) .font(.gbSans(.body)) .tint(.gbAccent) // The screenshot checkpoint forces appearance per run; // simulator clones ignore the base device's setting. .preferredColorScheme(Self.forcedColorScheme) } } /// A clone follows whatever appearance it was created with, so the /// checkpoint has to name the one it wants. Neither flag means the /// app follows the system, as it does for real users. private static var forcedColorScheme: ColorScheme? { let args = ProcessInfo.processInfo.arguments if args.contains("-gb-dark") { return .dark } if args.contains("-gb-light") { return .light } return nil } }