-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to remove bounce effect on switchToViewController #33
Comments
There is currently no way to do that. |
Thanks. But for now. Can I just use the animation that was used in closing the slide menu to switchToViewController? |
Animations are for revealing the menu not the navigation controller. Create a category for SlideNavigationController. Add the following method and use it for switching viewControllers. I just wrote this haven't done much testing on it. So make sure it works for your need. It'll be tested and added to the new release - (void)switchToViewController:(UIViewController *)viewController withSlideOutAnimation:(BOOL)slideOutAnimation andCompletion:(void (^)())completion {
if (self.avoidSwitchingToSameClassViewController && [self.topViewController isKindOfClass:viewController.class])
{
[self closeMenuWithCompletion:completion];
return;
}
void (^switchAndCloseMenu)(void) = ^() {
[super popToRootViewControllerAnimated:NO];
[super pushViewController:viewController animated:NO];
[self closeMenuWithCompletion:^{
if (completion)
completion();
}];
};
if ([self isMenuOpen])
{
if (slideOutAnimation)
{
[UIView animateWithDuration:(slideOutAnimation) ? MENU_SLIDE_ANIMATION_DURATION : 0
delay:0
options:UIViewAnimationOptionCurveEaseOut
animations:^{
CGFloat width = self.horizontalSize;
CGFloat moveLocation = (self.horizontalLocation> 0) ? width : -1*width;
[self moveHorizontallyToLocation:moveLocation];
} completion:^(BOOL finished) {
switchAndCloseMenu();
}];
}
else
{
switchAndCloseMenu();
}
}
else
{
switchAndCloseMenu();
}
} |
Great! This seems to be working well. Thanks. |
Is there anyway to remove the bounce effect upon switchToViewController? I just want my viewController to appear on switchToViewController like when closing the slide navigation menu when tapping the leftBarButton (no bounce).
The text was updated successfully, but these errors were encountered: