remove iOS 13 check

This commit is contained in:
Scott Pfeil 2022-03-10 12:37:38 -05:00
parent e869a25cc6
commit ebf97cdbe7

View File

@ -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)
}