diff --git a/Passepartout/App/iOS/CHANGELOG.md b/Passepartout/App/iOS/CHANGELOG.md index 91665c1a..a52c2cea 100644 --- a/Passepartout/App/iOS/CHANGELOG.md +++ b/Passepartout/App/iOS/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- iOS 15: Navigation bar has broken appearance. - Missing account guidance footer in some providers. - Files imported via Music (iTunes) File Sharing did not show up. diff --git a/Passepartout/App/iOS/Global/Theme.swift b/Passepartout/App/iOS/Global/Theme.swift index fdc7ec0a..c5e7fb62 100644 --- a/Passepartout/App/iOS/Global/Theme.swift +++ b/Passepartout/App/iOS/Global/Theme.swift @@ -88,10 +88,22 @@ struct Theme { extension Theme { func applyAppearance() { + if #available(iOS 15, *) { + let navBar = UINavigationBarAppearance() + navBar.configureWithOpaqueBackground() + navBar.backgroundColor = palette.primaryBackground + navBar.titleTextAttributes = [.foregroundColor: palette.primaryLightText] + navBar.buttonAppearance.normal.titleTextAttributes = navBar.titleTextAttributes + navBar.doneButtonAppearance.normal.titleTextAttributes = navBar.titleTextAttributes + let appearance = UINavigationBar.appearance() + appearance.standardAppearance = navBar + appearance.scrollEdgeAppearance = appearance.standardAppearance + } + let bar = UINavigationBar.appearance() bar.barTintColor = palette.primaryBackground bar.tintColor = palette.primaryLightText - bar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: palette.primaryLightText] + bar.titleTextAttributes = [.foregroundColor: palette.primaryLightText] bar.largeTitleTextAttributes = bar.titleTextAttributes let pickerBar = UINavigationBar.appearance(whenContainedInInstancesOf: [UIDocumentBrowserViewController.self])