import Foundation import UIKit enum Storyboard: String { case Main func instantiate(_ viewController: VC.Type) -> VC { guard let vc = UIStoryboard(name: self.rawValue, bundle: nil) .instantiateViewController(withIdentifier: VC.storyboardIdentifier) as? VC else { fatalError("Couldn't instantiate \(VC.storyboardIdentifier) from \(self.rawValue)") } return vc } }