2018-10-28 08:36:56 +00:00
|
|
|
// swiftlint:disable all
|
2019-03-18 10:18:22 +00:00
|
|
|
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
2018-10-28 08:36:56 +00:00
|
|
|
|
|
|
|
// swiftlint:disable sorted_imports
|
|
|
|
import Foundation
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
// swiftlint:disable superfluous_disable_command
|
2021-08-07 10:09:00 +00:00
|
|
|
// swiftlint:disable file_length implicit_return
|
2018-10-28 08:36:56 +00:00
|
|
|
|
|
|
|
// MARK: - Storyboard Scenes
|
|
|
|
|
|
|
|
// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name
|
|
|
|
internal enum StoryboardScene {
|
2019-04-06 21:22:29 +00:00
|
|
|
internal enum About: StoryboardType {
|
|
|
|
internal static let storyboardName = "About"
|
|
|
|
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: About.self)
|
|
|
|
}
|
2018-10-28 08:36:56 +00:00
|
|
|
internal enum Main: StoryboardType {
|
|
|
|
internal static let storyboardName = "Main"
|
|
|
|
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UISplitViewController>(storyboard: Main.self)
|
|
|
|
|
|
|
|
internal static let accountIdentifier = SceneType<AccountViewController>(storyboard: Main.self, identifier: "AccountIdentifier")
|
|
|
|
|
|
|
|
internal static let configurationIdentifier = SceneType<ConfigurationViewController>(storyboard: Main.self, identifier: "ConfigurationIdentifier")
|
|
|
|
|
2019-03-18 21:00:55 +00:00
|
|
|
internal static let providerPoolViewController = SceneType<ProviderPoolViewController>(storyboard: Main.self, identifier: "ProviderPoolViewController")
|
|
|
|
|
2019-10-23 08:52:15 +00:00
|
|
|
internal static let serverNetworkViewController = SceneType<ServerNetworkViewController>(storyboard: Main.self, identifier: "ServerNetworkViewController")
|
|
|
|
|
2018-10-28 08:36:56 +00:00
|
|
|
internal static let serviceIdentifier = SceneType<UIKit.UINavigationController>(storyboard: Main.self, identifier: "ServiceIdentifier")
|
|
|
|
}
|
|
|
|
internal enum Organizer: StoryboardType {
|
|
|
|
internal static let storyboardName = "Organizer"
|
|
|
|
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: Organizer.self)
|
|
|
|
|
|
|
|
internal static let provider = SceneType<UIKit.UINavigationController>(storyboard: Organizer.self, identifier: "Provider")
|
|
|
|
|
|
|
|
internal static let wizardHostIdentifier = SceneType<UIKit.UINavigationController>(storyboard: Organizer.self, identifier: "WizardHostIdentifier")
|
|
|
|
}
|
2019-10-28 09:07:38 +00:00
|
|
|
internal enum Purchase: StoryboardType {
|
|
|
|
internal static let storyboardName = "Purchase"
|
|
|
|
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: Purchase.self)
|
|
|
|
}
|
2019-03-18 21:00:55 +00:00
|
|
|
internal enum Shortcuts: StoryboardType {
|
|
|
|
internal static let storyboardName = "Shortcuts"
|
|
|
|
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: Shortcuts.self)
|
2019-03-27 19:23:53 +00:00
|
|
|
|
2019-03-27 21:09:08 +00:00
|
|
|
internal static let shortcutsViewController = SceneType<UIKit.UINavigationController>(storyboard: Shortcuts.self, identifier: "ShortcutsViewController")
|
2019-03-18 21:00:55 +00:00
|
|
|
}
|
2018-10-28 08:36:56 +00:00
|
|
|
}
|
|
|
|
// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name
|
|
|
|
|
|
|
|
// MARK: - Implementation Details
|
|
|
|
|
|
|
|
internal protocol StoryboardType {
|
|
|
|
static var storyboardName: String { get }
|
|
|
|
}
|
|
|
|
|
|
|
|
internal extension StoryboardType {
|
|
|
|
static var storyboard: UIStoryboard {
|
|
|
|
let name = self.storyboardName
|
2020-07-07 21:34:42 +00:00
|
|
|
return UIStoryboard(name: name, bundle: BundleToken.bundle)
|
2018-10-28 08:36:56 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
internal struct SceneType<T: UIViewController> {
|
|
|
|
internal let storyboard: StoryboardType.Type
|
|
|
|
internal let identifier: String
|
|
|
|
|
|
|
|
internal func instantiate() -> T {
|
|
|
|
let identifier = self.identifier
|
|
|
|
guard let controller = storyboard.storyboard.instantiateViewController(withIdentifier: identifier) as? T else {
|
|
|
|
fatalError("ViewController '\(identifier)' is not of the expected class \(T.self).")
|
|
|
|
}
|
|
|
|
return controller
|
|
|
|
}
|
2021-08-07 10:09:00 +00:00
|
|
|
|
|
|
|
@available(iOS 13.0, tvOS 13.0, *)
|
|
|
|
internal func instantiate(creator block: @escaping (NSCoder) -> T?) -> T {
|
|
|
|
return storyboard.storyboard.instantiateViewController(identifier: identifier, creator: block)
|
|
|
|
}
|
2018-10-28 08:36:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
internal struct InitialSceneType<T: UIViewController> {
|
|
|
|
internal let storyboard: StoryboardType.Type
|
|
|
|
|
|
|
|
internal func instantiate() -> T {
|
|
|
|
guard let controller = storyboard.storyboard.instantiateInitialViewController() as? T else {
|
|
|
|
fatalError("ViewController is not of the expected class \(T.self).")
|
|
|
|
}
|
|
|
|
return controller
|
|
|
|
}
|
2021-08-07 10:09:00 +00:00
|
|
|
|
|
|
|
@available(iOS 13.0, tvOS 13.0, *)
|
|
|
|
internal func instantiate(creator block: @escaping (NSCoder) -> T?) -> T {
|
|
|
|
guard let controller = storyboard.storyboard.instantiateInitialViewController(creator: block) else {
|
|
|
|
fatalError("Storyboard \(storyboard.storyboardName) does not have an initial scene.")
|
|
|
|
}
|
|
|
|
return controller
|
|
|
|
}
|
2018-10-28 08:36:56 +00:00
|
|
|
}
|
|
|
|
|
2020-07-07 21:34:42 +00:00
|
|
|
// swiftlint:disable convenience_type
|
|
|
|
private final class BundleToken {
|
|
|
|
static let bundle: Bundle = {
|
2021-08-07 10:09:00 +00:00
|
|
|
#if SWIFT_PACKAGE
|
|
|
|
return Bundle.module
|
|
|
|
#else
|
|
|
|
return Bundle(for: BundleToken.self)
|
|
|
|
#endif
|
2020-07-07 21:34:42 +00:00
|
|
|
}()
|
|
|
|
}
|
|
|
|
// swiftlint:enable convenience_type
|