title: Using UIPageViewController with Multiple Views
body: <p>I have the following code to create a UIPageViewController:</p>
  
  <pre><code>- (void)viewDidLoad
  {
  [super viewDidLoad];
  
  self.index = 0;
  
  self.pageContainer = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
  
  self.pageContainer.dataSource = self;
  [[self.pageContainer view] setFrame:[[self view] bounds]];
  
  DMSignUp1ViewController *first = [[DMSignUp1ViewController alloc] init];
  DMSignUp2ViewController *second = [[DMSignUp2ViewController alloc] init];
  
  self.viewControllers = [[NSArray alloc] initWithObjects:first, second, nil];
  
  [self.pageContainer setViewControllers:self.viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil];
  
  [self addChildViewController:self.pageContainer];
  [[self view] addSubview:[self.pageContainer view]];
  [self.pageContainer didMoveToParentViewController:self];
  }
  
  - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController
  {
      if(self.index == 0) {
          return nil;
      }
  
      self.index--;
      return [self.viewControllers objectAtIndex:self.index];
  }
  
  - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController
  {
      if(self.index == 1) {
          return nil;
      }
  
      self.index++;
      return [self.viewControllers objectAtIndex:self.index];
  }
  </code></pre>
  
  <p>I have two UIViewControllers: DMSignUp1 and 2 which I create and then place in the viewControllers array.</p>
  
  <p>When I go to run it, I get the following error: 'The number of view controllers provided (2) doesn't match the number required (1) for the requested transition'</p>
  
  <p>Which I understand is because I am passing the array to use as the view controller. So how do I set that I want to use the first view controller in the array? </p>