diff --git a/JellyfinPlayer/App/AppDelegate.swift b/JellyfinPlayer/App/AppDelegate.swift index 1da457bf..d41c406f 100644 --- a/JellyfinPlayer/App/AppDelegate.swift +++ b/JellyfinPlayer/App/AppDelegate.swift @@ -7,6 +7,7 @@ * Copyright 2021 Aiden Vigue & Jellyfin Contributors */ +import SwiftUI import UIKit class AppDelegate: NSObject, UIApplicationDelegate { @@ -17,16 +18,10 @@ class AppDelegate: NSObject, UIApplicationDelegate { // Lazily initialize datastack let _ = SwiftfinStore.dataStack - setupAppearance() - return true } func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { AppDelegate.orientationLock } - - private func setupAppearance() { -// UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style - } } diff --git a/JellyfinPlayer/App/JellyfinPlayerApp.swift b/JellyfinPlayer/App/JellyfinPlayerApp.swift index 8810e4ce..bfd5b86e 100644 --- a/JellyfinPlayer/App/JellyfinPlayerApp.swift +++ b/JellyfinPlayer/App/JellyfinPlayerApp.swift @@ -18,7 +18,12 @@ struct JellyfinPlayerApp: App { var body: some Scene { WindowGroup { - EmptyView() + // TODO: Replace with a SplashView + Color(appAppearance.style == .dark ? UIColor.black : UIColor.white) + .ignoresSafeArea() + .onAppear { + setupAppearance() + } .withHostingWindow { window in window?.rootViewController = PreferenceUIHostingController(wrappedView: MainCoordinator().view()) } @@ -30,6 +35,10 @@ struct JellyfinPlayerApp: App { } } } + + private func setupAppearance() { + UIApplication.shared.windows.first?.overrideUserInterfaceStyle = appAppearance.style + } } // MARK: Hosting Window