Last active
August 29, 2015 14:20
-
-
Save motokiee/89191a8b78b73a734834 to your computer and use it in GitHub Desktop.
UIStroyboard Extension
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
extension UIStoryboard { | |
/** | |
StoryboardからUIViewControllerを取り出す | |
:param: storyboardName 取り出すstoryboard名 | |
:param: viewControllerName 取り出したいviewcontroller名 | |
:returns: viewController | |
*/ | |
class func instantiateViewController(storyboardName: String, viewControllerName: String) -> UIViewController { | |
let stroyboard = UIStoryboard(name: storyboardName, bundle: nil) | |
let viewController: UIViewController | |
= stroyboard.instantiateViewControllerWithIdentifier(viewControllerName) as! UIViewController | |
return viewController | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment