Loading ViewController from xib file
<p>I had a <code>MyViewController.swift</code> and a <code>MyViewController.xib</code> presenting the layout of MyViewController.</p>

<p>I tried different methods to load this view controller including:</p>

<pre><code>//1
let myVC = UINib(nibName: "MyViewController", bundle:
       nil).instantiateWithOwner(nil, options: nil)[0] as? MyViewController

//2
let myVC = NSBundle.mainBundle().loadNibNamed("MyViewController", owner: self, options: nil)[0] as? MyViewController

//3
let myVC = MyViewController(nibName: "MyViewController", bundle: nil)
</code></pre>

<p>The third one is the only successful initialisation, but the previous two are causing error:</p>

<blockquote>
  <p>Terminating app due to uncaught exception 'NSUnknownKeyException',</p>
  
  <p>reason: '[ setValue:forUndefinedKey:]: this
  class is not key value coding-compliant for the key XXX.</p>
</blockquote>

<p>What's wrong with those loading methods?</p>