title: Mandatory init override in Swift UINavigationController subclass
body: <p>I'm currently subclassing a <code>UINavigationController</code> for a framework that serves a view controller flow (in a way, like <code>UIImagePickerController</code> do)</p>
  
  <p>Here's an example of my implementation, reduced to be as simple as possible, that can be run in a playground.</p>
  
  <pre><code>import UIKit
  
  public class MyNavigationController: UINavigationController {
  
      public var anyVar: Int?
  
      public init(anyVar: Int) {
          let viewController = UIViewController()
          super.init(rootViewController: viewController)
  
          self.anyVar = anyVar
      }
  
      required public init?(coder aDecoder: NSCoder) {
          super.init(coder: aDecoder)
      }
  }
  
  let navigationController = MyNavigationController(anyVar: 42)
  </code></pre>
  
  <p>The last line is crashing, with a <code>EXC_BAD_INSTRUCTION</code>. When I run in Xcode, it's tells me <strong>at runtime</strong> that <code>init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?)</code> was missing. </p>
  
  <p>And if I override the method:</p>
  
  <pre><code>public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
      super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
  }
  </code></pre>
  
  <p>...everything works well: you can try with your own playground.</p>
  
  <p>I can't understand why. It doesn't sounds logic to me.</p>
  
  <p>The <code>UIViewController</code> documentation says:</p>
  
  <blockquote>
    <p>If you subclass UIViewController, you must call the super implementation of this
          method, even if you aren't using a NIB.  (As a convenience, the default init method will do this for you,
          and specify nil for both of this methods arguments.)</p>
  </blockquote>
  
  <p>But my <code>init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?)</code> override gets called, from <code>super.init(rootViewController: viewController)</code> initialization!<br>
  Without overriding it, I guess the UIViewController's <code>init(nibName:bundle:)</code> should be called, but not.</p>
  
  <p>I still cannot understand why overriding the method and calling <code>super</code> make the program works better. IMO, overriding a method while only calling <code>super.thisMethod</code> is totally useless, it only adds a method call in the call stack.</p>
  
  <p>I must missing something essentials about Swift init methods, but I can't figure out what.</p>