Skip to content

Instantly share code, notes, and snippets.

@aciidgh
Last active January 15, 2016 12:53
Show Gist options
  • Save aciidgh/5d7ca5e7bdbc05fe5b8b to your computer and use it in GitHub Desktop.
Save aciidgh/5d7ca5e7bdbc05fe5b8b to your computer and use it in GitHub Desktop.
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