0

I can't find an example of resetTopViewWithAnimations being used anywhere. The sample app doesn't use animations, and every forum I've seen doesn't mention how to actually implement animations using this method. Can someone explain how I would achieve a basic bounce effect (view resets to center and then bounces a few times) by using this?

https://github.com/edgecase/ECSlidingViewController

- (void)resetTopViewWithAnimations:(void(^)())animations onComplete:(void(^)())complete
{
  [self topViewHorizontalCenterWillChange:self.resettedCenter];

  [UIView animateWithDuration:0.25f animations:^{
    if (animations) {
      animations();
    }
    [self updateTopViewHorizontalCenter:self.resettedCenter];
  } completion:^(BOOL finished) {
    if (complete) {
      complete();
    }
    [self topViewHorizontalCenterDidChange:self.resettedCenter];
  }];
}
davis
  • 1,911
  • 6
  • 26
  • 50

1 Answers1

0

Version 1 of ECSlidingViewController doesn't support customizing the default sliding animation. The intention of the animation block is to animate your own subviews during the built in slide animation.

You might be able to get away with some tricks by animating the transition yourself and then calling the sliding view controller's reset while disable its animations.

I would recommend moving to iOS 7 and upgrading to ECSlidingViewController 2. There is support for custom transitions and you'll be able to customize the animation.

Michael Enriquez
  • 2,520
  • 21
  • 13