Managers handle navigation bar

nullable
This commit is contained in:
Pfeil, Scott Robert 2021-06-11 11:04:47 -04:00
parent 1d556b6563
commit 48d427ec4e
3 changed files with 8 additions and 8 deletions

View File

@ -108,16 +108,16 @@ import UIKit
/// Convenience function to return the navigation model of the lowest controller traversing managers
public static func getNavigationModel(from viewController: UIViewController) -> NavigationItemModelProtocol? {
let controller = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController)
guard let model = (controller as? PageProtocol)?.pageModel?.navigationBar else { return nil }
guard let controller = MVMCoreUIUtility.getViewControllerTraversingManagers(viewController),
let model = (controller as? PageProtocol)?.pageModel?.navigationBar else { return nil }
return model
}
}
extension NavigationController: MVMCoreViewManagerProtocol {
// TODO: change this to optional
public func getCurrentViewController() -> UIViewController {
return topViewController!
public func getCurrentViewController() -> UIViewController? {
return topViewController
}
public func containsPage(withPageType pageType: String?) -> Bool {

View File

@ -119,8 +119,8 @@ public extension MVMCoreUISplitViewController {
}
extension MVMCoreUISplitViewController: MVMCoreViewManagerProtocol {
public func getCurrentViewController() -> UIViewController {
navigationController!.getCurrentViewController()
public func getCurrentViewController() -> UIViewController? {
navigationController?.getCurrentViewController()
}
public func containsPage(withPageType pageType: String?) -> Bool {

View File

@ -32,10 +32,10 @@ NS_ASSUME_NONNULL_BEGIN
+ (UIEdgeInsets)getMarginsForView:(nullable UIView *)view;
/// Gets the current visible view controller. Checks presented view controllers first, and then it checks on the NavigationController in the session object.
+ (UIViewController *)getCurrentVisibleController;
+ (nullable UIViewController *)getCurrentVisibleController;
/// Gets the first non manager controller.
+ (UIViewController *)getViewControllerTraversingManagers:(UIViewController *)viewController;
+ (nullable UIViewController *)getViewControllerTraversingManagers:(UIViewController *)viewController;
/// Checks if the view or any descendents of the view is currently focused for voice over.
+ (BOOL)viewContainsAccessiblityFocus:(nonnull UIView *)view;