tokenary/Tokenary iOS/Content/Storyboard.swift

12 lines
419 B
Swift
Raw Normal View History

2021-12-07 20:35:14 +03:00
// Copyright © 2021 Tokenary. All rights reserved.
import UIKit
enum Storyboard: String {
case main
}
func instantiate<ViewController: UIViewController>(_ type: ViewController.Type, from storyboard: Storyboard) -> ViewController {
return UIStoryboard(name: storyboard.rawValue.withFirstLetterCapitalized, bundle: nil).instantiateViewController(withIdentifier: String(describing: type)) as! ViewController
}