Required init? erratum

This in the book:

required init?( coder: NSCoder ) { assertionFailure( "EmployeesPrintingView cannot be instantiated from a nib." ) }
Throws the error “self used before super.init call” (OSX 10.11 Xcode 7.2)

Deleting the offending code causes Xcode to suggest the solution, but for those who need it, the corrected code is:

required init?( coder: NSCoder ) { fatalError( "EmployeesPrintingView cannot be instantiated from a nib." ) }

2 Likes