Last active
January 15, 2016 12:53
-
-
Save aciidgh/5d7ca5e7bdbc05fe5b8b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
protocol StoryboardInstantiable { | |
static var storyboardID: String { get } | |
static func instance(storyboard: UIStoryboard) -> Self? | |
} | |
extension StoryboardInstantiable { | |
static func instance(storyboard: UIStoryboard) -> Self? { | |
return storyboard.instantiateViewControllerWithIdentifier(Self.storyboardID) as? Self | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment