I am trying to understand how initialization works in Swift with a subclass of UIViewController. I thought the main format was like that, but it throws errors ...
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) { //other code super.init(nibName: String?, bundle: NSBundle?) }
You pass types, not variables. Instead, you should pass variables.
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) { // Initialize variables. super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) }
Variables should now be initialized before calling super.init
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) { // Initialize variables. super.init() // as required }
Source: https://habr.com/ru/post/1543032/More articles:The priority value in the reactive (), as in the observation mode () (R Shiny) - rRaspberry Pi webcam cannot open video device - raspberry-piSeal, cat, insert in R, separated by a newline - ruser input timeout in perl - unixFlicker in IE11 on page load but not in developer mode - htmlHow to calculate GOP file size H264 - videoClang & libΠ‘++ Π½Π° BeagleBoard - c++Cross Plattform target for OS X and iOS with Swift? - iosStore PHP variable from HTML to JavaScript in Blade Laravel template - javascriptI / O error: socket off timer. What are the reasons? - javaAll Articles