required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
This is caused by the absence of the initializer init(coder aDecoder: NSCoder!)
on the target UIViewController
That method is required because instantiating a UIViewController from a UIStoryboard calls it.
- First method
Manually implementing init(coder aDecoder: NSCoder!)
on the target UIViewController
init(coder aDecoder: NSCoder!) { super.init(coder: aDecoder)} - Second method
Removing init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?)
on your target UIViewController
will inherit all of the required initializers from the superclass asDave Wood pointed on his below