Repo created
This commit is contained in:
parent
4af19165ec
commit
68073add76
12458 changed files with 12350765 additions and 2 deletions
31
iphone/Maps/UI/Storyboard/Storyboard.swift
Normal file
31
iphone/Maps/UI/Storyboard/Storyboard.swift
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
@objc(MWMStoryboard)
|
||||
enum Storyboard: Int {
|
||||
case launchScreen
|
||||
case main
|
||||
case welcome
|
||||
case sharing
|
||||
case categorySettings
|
||||
case carPlay
|
||||
case placePage
|
||||
}
|
||||
|
||||
extension UIStoryboard {
|
||||
@objc static func instance(_ id: Storyboard) -> UIStoryboard {
|
||||
let name: String
|
||||
switch id {
|
||||
case .launchScreen: name = "LaunchScreen"
|
||||
case .main: name = "Main"
|
||||
case .welcome: name = "Welcome"
|
||||
case .sharing: name = "BookmarksSharingFlow"
|
||||
case .categorySettings: name = "CategorySettings"
|
||||
case .carPlay: name = "CarPlayStoryboard"
|
||||
case .placePage: name = "PlacePage"
|
||||
}
|
||||
return UIStoryboard(name: name, bundle: nil)
|
||||
}
|
||||
|
||||
func instantiateViewController<T: UIViewController>(ofType: T.Type) -> T {
|
||||
let name = String(describing: ofType);
|
||||
return self.instantiateViewController(withIdentifier: name) as! T;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue