diff --git a/SlideMenu/Source/SlideNavigationController.m b/SlideMenu/Source/SlideNavigationController.m index f932d84..2e43ceb 100644 --- a/SlideMenu/Source/SlideNavigationController.m +++ b/SlideMenu/Source/SlideNavigationController.m @@ -219,23 +219,30 @@ static SlideNavigationController *singletonInstance; } void (^switchAndCallCompletion)(BOOL) = ^(BOOL closeMenuBeforeCallingCompletion) { - if (poptype == PopTypeAll) { - [self setViewControllers:@[viewController]]; - } - else { - [super popToRootViewControllerAnimated:NO]; - [super pushViewController:viewController animated:NO]; - } + + void (^setNewControllerBlock)() = ^{ + if (poptype == PopTypeAll) { + [self setViewControllers:@[viewController]]; + } + else { + [super popToRootViewControllerAnimated:NO]; + [super pushViewController:viewController animated:NO]; + } + }; if (closeMenuBeforeCallingCompletion) { [self closeMenuWithCompletion:^{ + setNewControllerBlock(); + if (completion) completion(); }]; } else { + setNewControllerBlock(); + if (completion) completion(); }