remove iOS 13 check
This commit is contained in:
parent
e869a25cc6
commit
ebf97cdbe7
@ -105,25 +105,18 @@ import UIKit
|
|||||||
let backgroundColor = navigationItemModel.backgroundColor?.uiColor
|
let backgroundColor = navigationItemModel.backgroundColor?.uiColor
|
||||||
let tint = navigationItemModel.tintColor.uiColor
|
let tint = navigationItemModel.tintColor.uiColor
|
||||||
navigationBar.tintColor = tint
|
navigationBar.tintColor = tint
|
||||||
if #available(iOS 13.0, *) {
|
|
||||||
let appearance = UINavigationBarAppearance()
|
let appearance = UINavigationBarAppearance()
|
||||||
appearance.configureWithOpaqueBackground()
|
appearance.configureWithOpaqueBackground()
|
||||||
appearance.titleTextAttributes = [NSAttributedString.Key.font: font,
|
appearance.titleTextAttributes = [NSAttributedString.Key.font: font,
|
||||||
NSAttributedString.Key.foregroundColor: tint];
|
NSAttributedString.Key.foregroundColor: tint];
|
||||||
appearance.backgroundColor = backgroundColor
|
appearance.backgroundColor = backgroundColor
|
||||||
appearance.titleTextAttributes.updateValue(tint, forKey: .foregroundColor)
|
appearance.titleTextAttributes.updateValue(tint, forKey: .foregroundColor)
|
||||||
appearance.shadowColor = navigationItemModel.line?.backgroundColor?.uiColor ?? .clear
|
appearance.shadowColor = navigationItemModel.line?.backgroundColor?.uiColor ?? .clear
|
||||||
appearance.shadowImage = getNavigationBarShadowImage(for: navigationItemModel)?.withRenderingMode(.alwaysTemplate)
|
appearance.shadowImage = getNavigationBarShadowImage(for: navigationItemModel)?.withRenderingMode(.alwaysTemplate)
|
||||||
navigationBar.standardAppearance = appearance
|
navigationBar.standardAppearance = appearance
|
||||||
navigationBar.scrollEdgeAppearance = 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
|
|
||||||
}
|
|
||||||
navigationController.setNavigationBarHidden(navigationItemModel.hidden, animated: true)
|
navigationController.setNavigationBarHidden(navigationItemModel.hidden, animated: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user