title: Simple Page Control
body: <p>I have a scroll view which switches between two views.  The two views are set up in viewDidLoad.  I want to have a page control that switches when the according view is selected.</p>
  
  <p>All tutorials I have looked at have been far to complex.</p>
  
  <pre><code>- (void)viewDidLoad {
  
      [super viewDidLoad];
  
      scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, scrollView.frame.size.height);
      scrollView.showsHorizontalScrollIndicator = NO;
      scrollView.showsVerticalScrollIndicator = NO;
      scrollView.scrollsToTop = NO;
      scrollView.delegate = self;
  
      CGRect pageFrame = CGRectMake(0, 0, scrollView.bounds.size.width, scrollView.bounds.size.height);
      scrollView.contentSize = CGSizeMake(pageFrame.size.width * 2, pageFrame.size.height);
      scrollView.pagingEnabled = YES;
  
      view1.frame = pageFrame;
      [scrollView addSubview:view1];
  
  
      pageFrame.origin.x += pageFrame.size.width;
      view2.frame = pageFrame;
      [scrollView addSubview:view2];
  }
  
  - (IBAction)changePage:(id)sender {
  
  }
  </code></pre>