title: SWIFT uiviewcontroller init
body: <p>I am starting to use <strong>Swift</strong>. </p>
  
  <p>with <strong>Objective-C</strong> when I could avoid using storyboard, initializing a view controller was easy. I would just create a <code>UIViewController</code> subclass, and I would put all the initialization code inside 
  <code>initWithNibName</code>.</p>
  
  <p>Now with storyboard I'm lost. I created a <code>UIviewController</code> subclass, I tried adding <code>init</code>(nib name) and <code>init</code>(coder) but it crashes. </p>
  
  <p>This is my code:</p>
  
  <pre><code>   //
      //  SecondViewController.swift
      //  tabTestWithSwift
      //
      //  Created by Marianna Ruggieri  on 02/11/14.
      //  Copyright (c) 2014 Marianna Ruggieri. All rights reserved.
      //
  
      import UIKit
  
  class FirstViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
          println("init with nib")
          super.init()
          tabBarItem.title = "test"
      }
  
      required init(coder aDecoder: NSCoder) {
          //fatalError("init(coder:) has not been implemented")
          print("init coder")
          super.init()
      }
  
  }
  </code></pre>
  
  <p>See this screenshot:
  <a href="http://oi62.tinypic.com/10ogwsh.jpg" rel="nofollow noreferrer">http://oi62.tinypic.com/10ogwsh.jpg</a></p>
  
  <p>EDIT: I didn't do anything special. Started a <code>TabBar</code> project and edited the view controller as you see in the code above. That's it!!!!</p>
  
  <p>Which is the correct way to initialize a <code>UIViewController</code> if I'm using storyboard? Where should I put all the settings for my view controller? The load is too late for certain settings.</p>