From ebf97cdbe783108183c8114fddf31807ae88d59a Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Thu, 10 Mar 2022 12:37:38 -0500 Subject: [PATCH] remove iOS 13 check --- .../Containers/NavigationController.swift | 31 +++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/MVMCoreUI/Containers/NavigationController.swift b/MVMCoreUI/Containers/NavigationController.swift index 6b1e6100..3682fd6b 100644 --- a/MVMCoreUI/Containers/NavigationController.swift +++ b/MVMCoreUI/Containers/NavigationController.swift @@ -105,25 +105,18 @@ import UIKit let backgroundColor = navigationItemModel.backgroundColor?.uiColor let tint = navigationItemModel.tintColor.uiColor navigationBar.tintColor = tint - if #available(iOS 13.0, *) { - let appearance = UINavigationBarAppearance() - appearance.configureWithOpaqueBackground() - appearance.titleTextAttributes = [NSAttributedString.Key.font: font, - NSAttributedString.Key.foregroundColor: tint]; - appearance.backgroundColor = backgroundColor - appearance.titleTextAttributes.updateValue(tint, forKey: .foregroundColor) - appearance.shadowColor = navigationItemModel.line?.backgroundColor?.uiColor ?? .clear - appearance.shadowImage = getNavigationBarShadowImage(for: navigationItemModel)?.withRenderingMode(.alwaysTemplate) - navigationBar.standardAppearance = appearance - navigationBar.scrollEdgeAppearance = appearance - } else { - // Fallback on earlier versions - navigationBar.isOpaque = true - navigationBar.shadowImage = getNavigationBarShadowImage(for: navigationItemModel) - navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font, - NSAttributedString.Key.foregroundColor: tint]; - navigationBar.barTintColor = backgroundColor - } + + let appearance = UINavigationBarAppearance() + appearance.configureWithOpaqueBackground() + appearance.titleTextAttributes = [NSAttributedString.Key.font: font, + NSAttributedString.Key.foregroundColor: tint]; + appearance.backgroundColor = backgroundColor + appearance.titleTextAttributes.updateValue(tint, forKey: .foregroundColor) + appearance.shadowColor = navigationItemModel.line?.backgroundColor?.uiColor ?? .clear + appearance.shadowImage = getNavigationBarShadowImage(for: navigationItemModel)?.withRenderingMode(.alwaysTemplate) + navigationBar.standardAppearance = appearance + navigationBar.scrollEdgeAppearance = appearance + navigationController.setNavigationBarHidden(navigationItemModel.hidden, animated: true) }