Skip to content

Instantly share code, notes, and snippets.

@foxfriends
Last active September 6, 2019 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save foxfriends/6b86782a669ef087c5a3fcbe0da479b3 to your computer and use it in GitHub Desktop.
Save foxfriends/6b86782a669ef087c5a3fcbe0da479b3 to your computer and use it in GitHub Desktop.
import UIKit
enum Storyboard: String {
case main = "Main"
}
protocol ViewControllerNavigation {
static var storyboard: Storyboard { get }
static var identifier: String { get }
}
extension ViewControllerNavigation {
static func instantiate() -> Self {
return UIStoryboard(name: Self.storyboard.rawValue, bundle: nil).instantiateViewController(withIdentifier: identifier) as! Self
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment