title: How to slide child view controllers contained inside a UIViewController in iOS?
body: <p>Here's my current screen:</p>
  
  <p><img src="https://i.stack.imgur.com/Sba4F.png" alt="My Bookings screen"></p>
  
  <p>This screen consists of a UIViewController with programatically created buttons <code>Current Bookings</code> and <code>Old Bookings</code>. I have the logic on how to make the tapped active by adding a UIView as a subview to the UIButton. </p>
  
  <p>All the space below the buttons is occupied by a container view where I want to add different UIViewControllers based on which button is active. </p>
  
  <p>Initially, I do this to load one of the view controllers when the parent view appears,</p>
  
  <pre><code>DRMCurrentBookingsViewController *cbvc = [self.storyboard instantiateViewControllerWithIdentifier:@"CurrentBookingsController"];
  [self addChildViewController:cbvc];
  // 64 is the height of the navigation bar
  cbvc.view.frame = CGRectMake(0, 64+50, self.view.bounds.size.width, self.view.bounds.size.height-50);
  [container addSubview:cbvc.view];
  [cbvc didMoveToParentViewController:self];
  </code></pre>
  
  <p>Then, when the user taps on a different button, I use this code to switch the views.</p>
  
  <pre><code>DRMCurrentBookingsViewController *newController = [self.storyboard instantiateViewControllerWithIdentifier:@"CurrentBookingsController"];
  DRMOldBookingsViewController *oldController = [self.childViewControllers objectAtIndex:0];
  
          [oldController willMoveToParentViewController:nil];
          [self addChildViewController:newController];
  
          [self transitionFromViewController:oldController
                            toViewController:newController
                                    duration:0.5
                                     options:UIViewAnimationOptionTransitionNone
                                  animations:^{
                                      // no further animations required
                                      newController.view.frame = oldController.view.frame;
                                  }
                                  completion:^(BOOL finished) {
                                      [oldController removeFromParentViewController]; 
                                      [newController didMoveToParentViewController:self];
                                  }];
  </code></pre>
  
  <p>But, I want the child views to slide from left-right or right-left depending on which button is tapped and I do not want to select the pre-defined <code>UIViewAnimationOption</code>. <strong>I do not even wish to fade in the views</strong>. The views have to slide from one end to the other. </p>
  
  <p>How can I achieve this? </p>
  
  <p>Thanks for any help.</p>