title: Using UIScrollView to "rotate" between three views
body: <p>I have a <code>UIScrollView</code> which I have added three views <code>Z</code>, <code>A</code> and <code>B</code> as such:</p>
  
  <p><img src="https://i.stack.imgur.com/PRyeR.png" alt="enter image description here"></p>
  
  <p>What I would like to accomplish is have the three views be set in a "rotating" manner centered on view <code>A</code> appearing first. When a user swipes left and sees view <code>B</code>, swiping <strong>left</strong> again gets to view <code>Z</code>, and vise versa, swiping <strong>right</strong> when at view <code>Z</code> takes the user to view <code>B</code>.</p>
  
  <p>I have setup the code for <code>self.scrollview</code> as such:</p>
  
  <pre><code>ZViewController *zViewController = [[ZViewController alloc] init];
  [self addChildViewController:zViewController];
  [self.scrollView addSubview:zViewController.view];
  [zViewController didMoveToParentViewController:self];
  
  AViewController *aViewController = [[AViewController alloc] init];
  CGRect aframe = aViewController.view.frame;
  aframe.origin.x = 320;
  aViewController.view.frame = aframe;
  [self addChildViewController:aViewController];
  [self.scrollView addSubview:aViewController.view];
  [aViewController didMoveToParentViewController:self];
  
  BViewController *bViewController = [[BViewController alloc] init];
  CGRect bframe = bViewController.view.frame;
  bframe.origin.x = 640;
  bViewController.view.frame = bframe;
  [self addChildViewController:bViewController];
  [self.scrollView addSubview:bViewController.view];
  [bViewController didMoveToParentViewController:self];
  
  self.scrollView.contentSize = CGSizeMake(960, self.view.frame.size.height);
  self.scrollView.pagingEnabled = YES;
  </code></pre>
  
  <p>However, presently I am unsure how to proceed in terms getting the "rotation" element to work (i.e. swiping on <code>B</code> gets to <code>Z</code>) and would appreciate any help.</p>
  
  <p>Thanks!</p>