Initialize a subclass of UIViewController with Swift?
ios, ios8, swift
Solution
You're passing the types, not the variables. You have to pass the variables instead.
init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
// Initialize variables.
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
Problem
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?) } ```