Added view controller getter.

This commit is contained in:
Pfeil, Scott Robert 2020-10-08 11:31:40 -04:00
parent e60824ee1b
commit 43bd436225
3 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@ import UIKit
var leftItems: [UIBarButtonItem] = []
if navigationItemModel.alwaysShowBackButton != false {
if let backButtonModel = navigationItemModel.backButton,
navigationController.viewControllers.count > 1 || navigationItemModel.alwaysShowBackButton ?? false {
MVMCoreNavigationHandler.shared()?.getViewControllers(for: navigationController)?.count ?? 0 > 1 || navigationItemModel.alwaysShowBackButton ?? false {
leftItems.append(backButtonModel.createNavigationItemButton(delegateObject: delegate, additionalData: nil))
}
if let leftItemModels = navigationItemModel.additionalLeftButtons {

View File

@ -48,7 +48,7 @@ public extension MVMCoreUISplitViewController {
if let forceBackButton = navigationItemModel?.alwaysShowBackButton {
showBackButton = forceBackButton
} else {
showBackButton = navigationController.viewControllers.count > 1
showBackButton = MVMCoreNavigationHandler.shared()?.getViewControllers(for: navigationController)?.count ?? 0 > 1
}
if showBackButton {
if let backButtonModel = navigationItemModel?.backButton {

View File

@ -241,7 +241,7 @@ CGFloat const PanelAnimationDuration = 0.2;
- (void)setLeftNavigationItemForViewController:(UIViewController * _Nonnull)viewController accessible:(BOOL)accessible extended:(BOOL)extended {
NSMutableArray *leftBarButtonItems = [NSMutableArray array];
if ([viewController.navigationController.viewControllers count] > 1) {
if (viewController.navigationController && [MVMCoreNavigationHandler.sharedNavigationHandler getViewControllersForNavigationController:viewController.navigationController].count > 1) {
[leftBarButtonItems addObject:self.backButton];
}
if ((accessible && !extended) && self.leftPanelButton) {