title: PageViewController with ViewControllers
body: <p>I wasn't able to find a working example of a PageViewController with View Controllers as pages. </p>
  
  <p>I just need two horizontal view controllers: viewcontroller1 and viewcontroller2.</p>
  
  <p>Here is my viewDidLoad:</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
      self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationVertical options:nil];
  
      self.pageController.dataSource = self;
      [[self.pageController view] setFrame:[[self view] bounds]];
  
      storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil];
      controller1 = [storyboard instantiateViewControllerWithIdentifier:@"first"];
      controller2 = [storyboard instantiateViewControllerWithIdentifier:@"second"];
  
      viewControllers = [NSArray arrayWithObjects:controller1, nil];
  
      [self.pageController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
  
      [self addChildViewController:self.pageController];
      [[self view] addSubview:[self.pageController view]];
      [self.pageController didMoveToParentViewController:self];
  }
  
  
  - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController {
      return controller1;
  }
  
  - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController {
      return controller2;
  }
  </code></pre>
  
  <p>The problem is, after swiping the second view, it disappears.
  Some help understanding the PageViewController would be really nice.</p>
  
  <p>Thanks in advance</p>