Created
September 3, 2015 09:46
-
-
Save dennisfarandy/2c6e509e91ceb5005336 to your computer and use it in GitHub Desktop.
initialization viewcontroller by : http://napora.org/nscoder-and-swift-initialization/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooViewController: UIViewController { | |
let name: String | |
init(_ coder: NSCoder? = nil) { | |
name = "Bar" | |
if let coder = coder { | |
super.init(coder: coder) | |
} else { | |
super.init(nibName: nil, bundle:nil) | |
} | |
} | |
required convenience init(coder: NSCoder) { | |
self.init(coder) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment