Slide menu show new controller after menu closing

This commit is contained in:
Anton 2015-08-27 17:11:42 +03:00
parent d088879c28
commit 9550d4719b
1 changed files with 14 additions and 7 deletions

View File

@ -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();
}