name update
This commit is contained in:
parent
a03965cafe
commit
44a57ab96e
@ -33,7 +33,7 @@ open class NavigationBar: UINavigationBar, MoleculeViewProtocol {
|
||||
|
||||
open func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||
guard let model = model as? NavigationItemModel else { return }
|
||||
NavigationController.setNavigation(bar: self, model: model)
|
||||
NavigationController.set(navigationBar: self, model: model)
|
||||
line.setOptional(with: model.line, delegateObject, additionalData)
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,17 +83,17 @@ import UIKit
|
||||
let navigationBar = navigationBar as? MoleculeViewProtocol {
|
||||
navigationBar.set(with: model, nil, nil)
|
||||
} else {
|
||||
setNavigation(bar: navigationController.navigationBar, model: navigationItemModel)
|
||||
set(navigationBar: navigationController.navigationBar, model: navigationItemModel)
|
||||
}
|
||||
navigationController.setNavigationBarHidden(navigationItemModel.hidden, animated: true)
|
||||
}
|
||||
|
||||
/// Convenience function for setting the navigation bar by the model
|
||||
public static func setNavigation(bar: UINavigationBar, model: NavigationItemModelProtocol) {
|
||||
public static func set(navigationBar: UINavigationBar, model: NavigationItemModelProtocol) {
|
||||
let font = MFStyler.fontBoldBodySmall(false)
|
||||
let backgroundColor = model.backgroundColor?.uiColor
|
||||
let tint = model.tintColor.uiColor
|
||||
bar.tintColor = tint
|
||||
navigationBar.tintColor = tint
|
||||
if #available(iOS 13.0, *) {
|
||||
let appearance = UINavigationBarAppearance()
|
||||
appearance.configureWithOpaqueBackground()
|
||||
@ -101,15 +101,15 @@ import UIKit
|
||||
NSAttributedString.Key.foregroundColor: tint];
|
||||
appearance.backgroundColor = backgroundColor
|
||||
appearance.titleTextAttributes.updateValue(tint, forKey: .foregroundColor)
|
||||
bar.standardAppearance = appearance
|
||||
bar.scrollEdgeAppearance = appearance
|
||||
navigationBar.standardAppearance = appearance
|
||||
navigationBar.scrollEdgeAppearance = appearance
|
||||
} else {
|
||||
// Fallback on earlier versions
|
||||
bar.shadowImage = UIImage()
|
||||
bar.isOpaque = true
|
||||
bar.titleTextAttributes = [NSAttributedString.Key.font: font,
|
||||
navigationBar.shadowImage = UIImage()
|
||||
navigationBar.isOpaque = true
|
||||
navigationBar.titleTextAttributes = [NSAttributedString.Key.font: font,
|
||||
NSAttributedString.Key.foregroundColor: tint];
|
||||
bar.barTintColor = backgroundColor
|
||||
navigationBar.barTintColor = backgroundColor
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user