title: How to write init methods of a UIViewController in Swift
body: <p>I am unable to add init method to the following UIViewController class. I need to write some code in the init method. Do i have to write init(coder) method? Even when I add the coder and decoder methods I still get errors. I also tried using the init method without any parameters but that also does not seem to work.</p>
  
  <pre><code>class ViewController: UIViewController {
  
      var tap: UITapGestureRecognizer?
  
      override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?)   {
          super.init(nibName: nil, bundle: nil)
          tap = UITapGestureRecognizer(target: self, action: Selector("handleTap:"))
      }
  
  ...
  ...
  }
  </code></pre>
  
  <p>If I call the super.init() method without parameters the error is "Must call a designated initializer of super class" and if I pass the parameter nib and bundle then error is "Required initializer init(coder)".</p>
  
  <p>Even when I add init(coder) and init(decoder) it does not work.</p>