nav line hide for subnav
This commit is contained in:
parent
67c745c719
commit
a03965cafe
@ -88,7 +88,7 @@ import UIKit
|
||||
navigationController.setNavigationBarHidden(navigationItemModel.hidden, animated: true)
|
||||
}
|
||||
|
||||
/// Convenience function for settin the navigation bar by the model
|
||||
/// Convenience function for setting the navigation bar by the model
|
||||
public static func setNavigation(bar: UINavigationBar, model: NavigationItemModelProtocol) {
|
||||
let font = MFStyler.fontBoldBodySmall(false)
|
||||
let backgroundColor = model.backgroundColor?.uiColor
|
||||
|
||||
@ -78,7 +78,6 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
|
||||
if let controller = viewController as? (UIViewController & MVMCoreViewManagerViewControllerProtocol) {
|
||||
MVMCoreViewManagerViewControllerProtocolHelper.helpSetManager(self, viewController: controller)
|
||||
}
|
||||
hideNavigationBarLine(for: viewController)
|
||||
}
|
||||
|
||||
required public init?(coder: NSCoder) {
|
||||
@ -111,17 +110,22 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
|
||||
}
|
||||
}
|
||||
|
||||
open override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
hideNavigationBarLine(true)
|
||||
}
|
||||
|
||||
open override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
|
||||
hideNavigationBarLine(false)
|
||||
// Notify showing view we will disappear.
|
||||
(viewController as? MVMCoreViewManagerViewControllerProtocol)?.managerWillDisappear?(self)
|
||||
}
|
||||
|
||||
/// Hides the navigation bar for the page.
|
||||
open func hideNavigationBarLine(for viewController: UIViewController) {
|
||||
/// Hides/Shows the navigation bar for the page.
|
||||
open func hideNavigationBarLine(_ isHidden: Bool) {
|
||||
guard let navigationBar = navigationController?.navigationBar as? NavigationBar else { return }
|
||||
navigationBar.isHidden = true
|
||||
navigationBar.line.isHidden = isHidden
|
||||
}
|
||||
|
||||
open override func updateViews() {
|
||||
@ -214,7 +218,6 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
|
||||
index != tabs.selectedIndex else { return }
|
||||
viewController = controller
|
||||
pageType = (viewController as? MVMCoreViewControllerProtocol)?.pageType
|
||||
hideNavigationBarLine(for: controller)
|
||||
if let viewController = getCurrentViewController() {
|
||||
manager?.willDisplay?(viewController)
|
||||
}
|
||||
@ -298,14 +301,10 @@ open class SubNavManagerController: ViewController, MVMCoreViewManagerProtocol,
|
||||
}
|
||||
|
||||
open func newDataReceived(in viewController: UIViewController) {
|
||||
if viewController == self.viewController {
|
||||
hideNavigationBarLine(for: viewController)
|
||||
}
|
||||
manager?.newDataReceived?(in: viewController)
|
||||
}
|
||||
|
||||
public func willDisplay(_ viewController: UIViewController) {
|
||||
hideNavigationBarLine(for: viewController)
|
||||
manager?.willDisplay?(viewController)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user