I'm trying to understand how initialization works in Swift with a subclass of a UIViewController. I thought the basic format was this, but it is throwing errors...
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
//other code
super.init(nibName: String?, bundle: NSBundle?)
}
Leandros :
You're passing the types, not the variables. You have to pass the variables instead.\n\ninit(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {\n // Initialize variables.\n\n super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)\n}\n",
2014-06-03T09:13:28
JulioBarros :
Variables should now be initialized before the call to super.init\n\ninit(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {\n\n // Initialize variables.\n\n super.init() // as required\n}\n",
2014-06-09T19:27:19