From ea16391639c6a2812c9cf3c032b80aa85eb90d4a Mon Sep 17 00:00:00 2001 From: Justin Mazzocchi <2831158+jzzocc@users.noreply.github.com> Date: Thu, 5 May 2022 20:29:24 -0700 Subject: [PATCH] Fix iOS 15 nav bar appearance --- System/AppDelegate.swift | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/System/AppDelegate.swift b/System/AppDelegate.swift index 4332bcb..57b18f6 100644 --- a/System/AppDelegate.swift +++ b/System/AppDelegate.swift @@ -27,6 +27,8 @@ extension AppDelegate: UIApplicationDelegate { didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { self.application = application + configureGlobalAppearance() + return true } @@ -40,3 +42,16 @@ extension AppDelegate: UIApplicationDelegate { deviceTokenSubject.send(completion: .failure(error)) } } + +private extension AppDelegate { + func configureGlobalAppearance() { + if #available(iOS 15, *) { + let appearance = UINavigationBarAppearance() + + appearance.configureWithDefaultBackground() + + UINavigationBar.appearance().standardAppearance = appearance + UINavigationBar.appearance().scrollEdgeAppearance = appearance + } + } +}