Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Fix iOS 15 nav bar appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
jzzocc committed May 6, 2022
1 parent 5ff2d41 commit ea16391
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions System/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ extension AppDelegate: UIApplicationDelegate {
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
self.application = application

configureGlobalAppearance()

return true
}

Expand All @@ -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
}
}
}

0 comments on commit ea16391

Please sign in to comment.