diff --git a/AlfrescoApp/Utils/UniversalDevice.m b/AlfrescoApp/Utils/UniversalDevice.m index b2f8d04ed..818f394b1 100644 --- a/AlfrescoApp/Utils/UniversalDevice.m +++ b/AlfrescoApp/Utils/UniversalDevice.m @@ -167,6 +167,19 @@ + (void)pushToDisplayViewController:(UIViewController *)viewController usingNavi } else { + if (viewController.navigationController) + { + NSArray *navigationStackControllers = viewController.navigationController.viewControllers; + NSMutableArray *mutableNavigationStackControllers = viewController.navigationController.viewControllers.mutableCopy; + [navigationStackControllers enumerateObjectsUsingBlock:^(UIViewController *currentController, NSUInteger idx, BOOL *stop) { + if (currentController == viewController) + { + [mutableNavigationStackControllers removeObject:currentController]; + } + }]; + viewController.navigationController.viewControllers = mutableNavigationStackControllers; + } + [navigationController pushViewController:viewController animated:animated]; } }