Search code examples
iosanimationuikitchildviewcontroller

swapFromViewController with animation?


I want to implement a sliding menu, where the user can smoothly slide from the first view controller to the second view controller. This should animate and bounce when the animation is not complete.

My tabs are all childViewControllers of one tabviewcontroller (holding a container and a tabbar), and use this code to switch between childviewcontrollers now: [self swapFromViewController:[self.childViewControllers objectAtIndex:0] toViewController:destinationViewController];, but this does not have animation and CGRects I can change together with my panGesture.

Is there a way to swap 2 childViewControllers out with animation (sliding from one to another), and have the animation respond to a pangesture (going back should go back in the direction of the first childviewcontroller)?


Solution

  • Have you considered using UIPageViewController? In your requirements description that what you are quite describing.