Moved to NavigationController
This commit is contained in:
parent
eba851f2ea
commit
5410cef8bf
@ -49,6 +49,7 @@ import UIKit
|
|||||||
viewController.navigationItem.accessibilityLabel = navigationItemModel.title
|
viewController.navigationItem.accessibilityLabel = navigationItemModel.title
|
||||||
viewController.navigationItem.hidesBackButton = (navigationItemModel.backButton != nil)
|
viewController.navigationItem.hidesBackButton = (navigationItemModel.backButton != nil)
|
||||||
setNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController)
|
setNavigationButtons(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController)
|
||||||
|
setNavigationTitle(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience function for setting the navigation buttons.
|
/// Convenience function for setting the navigation buttons.
|
||||||
@ -109,4 +110,12 @@ import UIKit
|
|||||||
}
|
}
|
||||||
setNavigationBarUI(navigationController: navigationController, navigationItemModel: barModel, viewController: viewController)
|
setNavigationBarUI(navigationController: navigationController, navigationItemModel: barModel, viewController: viewController)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the title of navigation item for the view controller based on model and splitview.
|
||||||
|
public static func setNavigationTitle(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol?, viewController: UIViewController) {
|
||||||
|
let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject
|
||||||
|
if let titleViewModel = navigationItemModel?.titleView, let molecule = MoleculeObjectMapping.shared()?.createMolecule(titleViewModel, delegateObject: delegate, additionalData: nil) {
|
||||||
|
viewController.navigationItem.titleView = molecule
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,8 +37,6 @@ public extension MVMCoreUISplitViewController {
|
|||||||
|
|
||||||
setNavigationIconColor(navigationItemModel.tintColor.uiColor)
|
setNavigationIconColor(navigationItemModel.tintColor.uiColor)
|
||||||
|
|
||||||
setNavigationTitle(navigationController: navigationController, navigationItemModel: navigationItemModel, viewController: viewController)
|
|
||||||
|
|
||||||
if let progress = progress {
|
if let progress = progress {
|
||||||
setBottomProgressBarProgress(progress)
|
setBottomProgressBarProgress(progress)
|
||||||
}
|
}
|
||||||
@ -110,14 +108,6 @@ public extension MVMCoreUISplitViewController {
|
|||||||
viewController.navigationItem.setRightBarButtonItems(rightItems.count > 0 ? rightItems : nil, animated: !DisableAnimations.boolValue)
|
viewController.navigationItem.setRightBarButtonItems(rightItems.count > 0 ? rightItems : nil, animated: !DisableAnimations.boolValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the title of navigation item for the view controller based on model and splitview.
|
|
||||||
func setNavigationTitle(navigationController: UINavigationController, navigationItemModel: NavigationItemModelProtocol?, viewController: UIViewController) {
|
|
||||||
let delegate = (viewController as? MVMCoreViewControllerProtocol)?.delegateObject?() as? MVMCoreUIDelegateObject
|
|
||||||
if let titleViewModel = navigationItemModel?.titleView, let molecule = MoleculeObjectMapping.shared()?.createMolecule(titleViewModel, delegateObject: delegate, additionalData: nil) {
|
|
||||||
viewController.navigationItem.titleView = molecule
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Legacy Functions
|
// MARK: - Legacy Functions
|
||||||
/// Convenience setter for legacy files. Sets the navigation item for the view controller based on the json and splitview controller
|
/// Convenience setter for legacy files. Sets the navigation item for the view controller based on the json and splitview controller
|
||||||
@objc static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationJSON: [String: Any], leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: NSNumber?) throws {
|
@objc static func setSplitViewController(for viewController: UIViewController, navigationController: UINavigationController, navigationJSON: [String: Any], leftPanelAccessible: Bool, rightPanelAccessible: Bool, progress: NSNumber?) throws {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user