I'm trying to push a view controller using:
var vc2 = ViewController2()
self.navigationController?.pushViewController(vc2, animated: false
)
but in my second view controller, I'm have:
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
But I get the error Missing argument for parameter 'coder' in call
in the first ViewController. What goes in the parenthesis in the first view controller?
There are two ways you can fix this issue:
The easy way, just call the function passing nil to the parameters:
The best way, create convenience initializers in your class:
and now you can call: