title: How to subclass custom UIViewController in Swift?
body: <p>I'd like to create a reusable view controller <code>UsersViewControllerBase</code>.</p>
  
  <p><code>UsersViewControllerBase</code> extends  <code>UIViewController</code>, and implements two delegates (<code>UITableViewDelegate</code>, <code>UITableViewDataSource</code>), and has two views (<code>UITableView</code>, <code>UISegmentedControl</code>)</p>
  
  <p>The goal is to inherit the implementation of the <code>UsersViewControllerBase</code> and customise the segmented items of segmented control in <code>UsersViewController</code> class.</p>
  
  <pre><code>class UsersViewControllerBase: UIViewController, UITableViewDelegate, UITableViewDataSource{
    @IBOutlet weak var segmentedControl: UISegmentedControl!
    @IBOutlet weak var tableView: UITableView!
    //implementation of delegates
  }
  
  class UsersViewController: UsersViewControllerBase {
  }
  </code></pre>
  
  <p>The <code>UsersViewControllerBase</code> is present in the storyboard and all outlets are connected, the identifier is specified. </p>
  
  <p>The question is how can I init the UsersViewController to inherit all the views and functionality of <code>UsersViewControllerBase</code></p>
  
  <p>When I create the instance of <code>UsersViewControllerBase</code> everything works</p>
  
  <pre><code>let usersViewControllerBase = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("UsersViewControllerBase") as? UsersViewControllerBase
  </code></pre>
  
  <p>But when I create the instance of <code>UsersViewController</code> I get <code>nil</code> outlets
  (I created a simple <code>UIViewController</code> and assigned the UsersViewController class to it in the storyboard )</p>
  
  <pre><code>let usersViewController = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("UsersViewController") as? UsersViewController
  </code></pre>
  
  <p>It looks like views are not inherited.</p>
  
  <p>I would expect init method in <code>UsersViewControllerBase</code> that gets controller with views and outlets from storyboard:</p>
  
  <pre><code>  class UsersViewControllerBase: UIViewController, UITableViewDelegate, UITableViewDataSource{
        @IBOutlet weak var segmentedControl: UISegmentedControl!
        @IBOutlet weak var tableView: UITableView!
        init(){
          let usersViewControllerBase = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()).instantiateViewControllerWithIdentifier("UsersViewControllerBase") as? UsersViewControllerBase
          self = usersViewControllerBase //but that doesn't compile
        }
      }
  </code></pre>
  
  <p>And I would init <code>UsersViewController</code>:</p>
  
  <pre><code>let usersViewController = UsersViewController()
  </code></pre>
  
  <p>But unfortunately that doesn't work</p>