Skip to content

Instantly share code, notes, and snippets.

@KanshuYokoo
Created September 15, 2018 07:46
Show Gist options
  • Save KanshuYokoo/98750245f263343992673fd53efde97d to your computer and use it in GitHub Desktop.
Save KanshuYokoo/98750245f263343992673fd53efde97d to your computer and use it in GitHub Desktop.
initialize view controler ios swift
convenience init() {
self.init(nibName:nil, bundle:nil)
}
// This extends the superclass.
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
// This is also necessary when extending the superclass.
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented") // or see Roman Sausarnes's answer
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment