Last active
August 29, 2015 14:03
-
-
Save nvkiet/9f6e8432e6bb329f300a to your computer and use it in GitHub Desktop.
Init a subview
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
Also for people referring to @akashivskyy answer, and having trouble or crash with error | |
fatal error: use of unimplemented initializer 'init(coder:)' for class | |
Implementing initWithCoder in Objective-C is not required but in Swift is required | |
So to use @akashivskyy's asnwer you need also to add these lines to your destinationViewController. | |
init(coder aDecoder: NSCoder!) | |
{ | |
super.init(coder: aDecoder) | |
} | |
or removing this at your destinationViewController, let's Swift inherit all superclass methods including the one I wrote above! | |
init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { | |
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) | |
// Here you can init your properties | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment