title: How to create a base view controller
body: <p>I would like to have a <code>BaseViewController</code> that subclasses <code>UIViewController</code>, overrides one of it's methods, but also require it's subclasses to implement new ones.</p>
  
  <p>My case is a bit more complex, but this simple case represents my problem:</p>
  
  <p>My <code>BaseViewController</code> would override <code>viewWillAppear</code> to set it's title, but the title string would come from it's subclasses. I thought about some options, not sure if/which one of them is best.</p>
  
  <p>1 - Class with error throwing methods (my current solution):</p>
  
  <pre><code>class BaseViewController: UIViewController {
    override func viewWillAppear(animated: Bool) {
      super.viewWillAppear(animated)
      title = getTitle()
    }
  
    func getTitle() -&gt; String {
      fatalError("Unimplemented method")
    }
  }
  </code></pre>
  
  <p>2 - Receive the title in constructor:</p>
  
  <pre><code>class BaseViewController: UIViewController {
    var myTitle: String!
  
    convenience init(title titleSent: String) {
      self.init(nibName: nil, bundle: nil)
      myTitle = sentTitle
    }
  
    override func viewWillAppear(animated: Bool) {
      super.viewWillAppear(animated)
      title = myTitle
    }
  }
  </code></pre>
  
  <p><em>Note that this options gets really bad if there's more parameters to send</em></p>
  
  <p>I thought that using <code>protocol</code> would be perfect, until I find out that (of course) protocols can't subclass a class.</p>
  
  <p>Didn't anybody do anything like this before? I don't think so, please share your thoughts.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I tried another way, but got stuck in a compiler error, would this ever work?</p>
  
  <pre><code>procotol BaseViewController {
    var myTitle: String { get }
  }
  
  extension BaseViewController where Self: UIViewController {
    override func viewWillAppear(animated: Bool) {
      super.viewWillAppear(animated)
      title = myTitle
    }
  }
  </code></pre>
  
  <p>The compiler says <code>Method does not override any method from its superclass</code>.</p>