title: Xcode XIB: how to implement a ScrollView or PageControl to swipe sub-views?
body: <p>I'm building a typical Xcode 6 iOS app. </p>
  
  <p>My goal is:</p>
  
  <ul>
  <li><p>A screen that has an sub-area that can be swiped to change the content. </p></li>
  <li><p>For example, the home screen has a logo image, a middle area that I want to be swipeable, and a bottom button.</p></li>
  <li><p>When the user swipes (or taps) the middle area, the area shows the next (or previous) information, which is a typical UIImage and UILabel caption.</p></li>
  <li><p>The rest of the screen stays the same, i.e. there is no navigation change.</p></li>
  </ul>
  
  <p>The code is <a href="https://gist.github.com/SixArm/9b5641accf56ff936e65" rel="nofollow noreferrer">here</a>. It use the recommendations from the StackOverflow post <a href="https://stackoverflow.com/questions/16391048/xcode-how-do-i-change-uipagecontrol-value-with-swipe-gesture">here</a>.</p>
  
  <p><b>My question: how can I implement the code below better, while still using an XIB?</b></p>
  
  <p>My current implementation does work, and uses this approach...</p>
  
  <p>A typical Swift <code>Demo.swift</code> file that is a UIViewController that has:</p>
  
  <ul>
  <li>the page index, min, and max</li>
  <li>outlets for the PageControl, UIImageView, and UILabel</li>
  <li>actions for the page control change, and the image swipe or tap</li>
  </ul>
  
  <p>A typical <code>Demo.xib</code> file that has:</p>
  
  <ul>
  <li>a typical UIViewController for the entire screen</li>
  <li>a UIImageView and UILabel for the changeable image and caption text</li>
  <li>a PageControl to indicate what tutorial page the user is viewing</li>
  </ul>
  
  <p>I am seeking better ways to accomplish this; I've read many of Xcode tutorials and so far none seem definitive for Xcode 6, XIBs, and Swift.</p>
  
  <p>Here are some implementations that I've researched that seem promising...</p>
  
  <p>Is there a way to implement a subview area in the XIB? </p>
  
  <ul>
  <li>For example, can Xocde show the XIB with a rectangular area that is intended for the changeable content?</li>
  </ul>
  
  <p>Is there an idiomatic way to write the code for changeable content?</p>
  
  <ul>
  <li>For example, by using a ScrollView, perhaps that contains a UIPageViewController?</li>
  </ul>
  
  <p>Is there a way to make a PageControl XIB object large enough to cover the entire UIImageView and UILabel, so I can skip making the UIImageView respond to gestures.</p>
  
  <ul>
  <li>In my Xcode, the PageControl seems to have an uneditable height that is always 37.</li>
  </ul>
  
  <p>The bounty will be for expert advice.</p>