title: How to customize the content of each page using Page Control and UIScrollView?
body: <p>I have problem with customizing each page using pagecontrol and UIScrollView.
  I'm customizing <a href="http://developer.apple.com/iphone/library/samplecode/PageControl/index.html" rel="nofollow noreferrer">Page Control</a> from Apple.</p>
  
  <p>Basically I would like to have each page different with text and image alternately on different page. Page 1 will have all text, Page 2 will have just images, Page 3 will have all text and goes on.</p>
  
  <p>This is original code:</p>
  
  <pre><code>    // Set the label and background color when the view has finished loading.
      - (void)viewDidLoad {
          pageNumberLabel.text = [NSString stringWithFormat:@"Page %d", pageNumber + 1];
          self.view.backgroundColor = [MyViewController pageControlColorWithIndex:pageNumber];
  }
  </code></pre>
  
  <p>As you can see, this code shows only Page 1, Page 2 etc as you scroll right.</p>
  
  <p>I tried to put in this new code but that didn't make any difference. There's no error.
  I know this is pretty simple code. I don't why it doesn't work.</p>
  
  <p>I declare pageText as UILabel.</p>
  
  <pre><code>// Set the label and background color when the view has finished loading.
  - (void)viewDidLoad {
      pageNumberLabel.text = [NSString stringWithFormat:@"Page %d", pageNumber + 1];
      self.view.backgroundColor = [MyViewController pageControlColorWithIndex:pageNumber];
      if (pageNumber == 1) {
          pageText.text = @"Text in page 1";
      }
      if (pageNumber == 2) {
              pageText.text = @"Image in page 2";
      }
      if (pageNumber == 3) {
              pageText.text = @"Text in page 3";
      }
  
  }
  </code></pre>
  
  <p>I don't know why it doesn't work. Also if you have better way to do it, let me know. Thanks.</p>