Search code examples
ioscocoa-touchanimationecslidingviewcontroller

ECSlidingViewController Remove Bounce Animation when selecting menu item


When you open and close the menu with the button it just snaps shut, however, when you click on an item withing the menu it bounces to the other side and then back again.

Although this is a nice effect it does not work so will with what I am doing presently, can this be disabled? I simply want it to snap shut when the user clicks a menu item.

EDIT

The code in didSelectecItemAtIndex is

UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:identifier];
[self.slidingViewController anchorTopViewOffScreenTo:ECLeft animations:nil onComplete:^{
        CGRect frame = self.slidingViewController.topViewController.view.frame;
        self.slidingViewController.topViewController = newTopViewController;
        self.slidingViewController.topViewController.view.frame = frame;
        [self.slidingViewController resetTopView];
    }];

Solution

  • I have the same problem but I found the solution. Here is my code:

    [self.slidingViewController anchorTopViewOffScreenTo:ECANCELED animations:nil onComplete:^{
                ObjHomeView.navigationItem.title=[[dataList objectAtIndex:indexPath.row] objectForKey:@"Menu_Name"];
                CGRect frame = self.slidingViewController.topViewController.view.frame;
                self.slidingViewController.topViewController = ObjHomeView;
                self.slidingViewController.topViewController.view.frame = frame;
                [self.slidingViewController resetTopView];
            }];
    

    Here

    [self.slidingViewController anchorTopViewoffScreenTo:ECANCELED animations:nil onComplete:^{
     You can put your code
    
    }];
    

    just put the argument ECCANCELED . I hope your problem will be solved.