157 lines
6.3 KiB
Swift
Generated
157 lines
6.3 KiB
Swift
Generated
// swiftlint:disable all
|
|
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
|
|
|
// swiftlint:disable sorted_imports
|
|
import Foundation
|
|
import AVKit
|
|
import ExtraModule
|
|
import GLKit
|
|
import LocationPicker
|
|
import SlackTextViewController
|
|
import SwiftGen
|
|
import UIKit
|
|
|
|
// swiftlint:disable superfluous_disable_command
|
|
// swiftlint:disable file_length implicit_return
|
|
|
|
// MARK: - Storyboard Scenes
|
|
|
|
// swiftlint:disable explicit_type_interface identifier_name line_length prefer_self_in_static_references
|
|
// swiftlint:disable type_body_length type_name
|
|
internal enum StoryboardScene {
|
|
internal enum AdditionalImport: StoryboardType {
|
|
internal static let storyboardName = "AdditionalImport"
|
|
|
|
internal static let initialScene = InitialSceneType<LocationPicker.LocationPickerViewController>(storyboard: AdditionalImport.self)
|
|
|
|
internal static let `public` = SceneType<SlackTextViewController.SLKTextViewController>(storyboard: AdditionalImport.self, identifier: "public")
|
|
}
|
|
internal enum Anonymous: StoryboardType {
|
|
internal static let storyboardName = "Anonymous"
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UINavigationController>(storyboard: Anonymous.self)
|
|
}
|
|
internal enum Dependency: StoryboardType {
|
|
internal static let storyboardName = "Dependency"
|
|
|
|
internal static let dependent = SceneType<ExtraModule.ValidatePasswordViewController>(storyboard: Dependency.self, identifier: "Dependent")
|
|
}
|
|
internal enum KnownTypes: StoryboardType {
|
|
internal static let storyboardName = "Known Types"
|
|
|
|
internal static let item1 = SceneType<GLKit.GLKViewController>(storyboard: KnownTypes.self, identifier: "item 1")
|
|
|
|
internal static let item2 = SceneType<AVKit.AVPlayerViewController>(storyboard: KnownTypes.self, identifier: "item 2")
|
|
|
|
internal static let item3 = SceneType<UIKit.UITabBarController>(storyboard: KnownTypes.self, identifier: "item 3")
|
|
|
|
internal static let item4 = SceneType<UIKit.UINavigationController>(storyboard: KnownTypes.self, identifier: "item 4")
|
|
|
|
internal static let item5 = SceneType<UIKit.UISplitViewController>(storyboard: KnownTypes.self, identifier: "item 5")
|
|
|
|
internal static let item6 = SceneType<UIKit.UIPageViewController>(storyboard: KnownTypes.self, identifier: "item 6")
|
|
|
|
internal static let item7 = SceneType<UIKit.UITableViewController>(storyboard: KnownTypes.self, identifier: "item 7")
|
|
|
|
internal static let item8 = SceneType<UIKit.UICollectionViewController>(storyboard: KnownTypes.self, identifier: "item 8")
|
|
|
|
internal static let item9 = SceneType<UIKit.UIViewController>(storyboard: KnownTypes.self, identifier: "item 9")
|
|
}
|
|
internal enum Message: StoryboardType {
|
|
internal static let storyboardName = "Message"
|
|
|
|
internal static let initialScene = InitialSceneType<UIKit.UIViewController>(storyboard: Message.self)
|
|
|
|
internal static let composer = SceneType<UIKit.UIViewController>(storyboard: Message.self, identifier: "Composer")
|
|
|
|
internal static let messagesList = SceneType<UIKit.UITableViewController>(storyboard: Message.self, identifier: "MessagesList")
|
|
|
|
internal static let navCtrl = SceneType<UIKit.UINavigationController>(storyboard: Message.self, identifier: "NavCtrl")
|
|
|
|
internal static let urlChooser = SceneType<PickerViewController>(storyboard: Message.self, identifier: "URLChooser")
|
|
}
|
|
internal enum Placeholder: StoryboardType {
|
|
internal static let storyboardName = "Placeholder"
|
|
|
|
internal static let navigation = SceneType<UIKit.UINavigationController>(storyboard: Placeholder.self, identifier: "Navigation")
|
|
}
|
|
internal enum Wizard: StoryboardType {
|
|
internal static let storyboardName = "Wizard"
|
|
|
|
internal static let initialScene = InitialSceneType<SwiftGen.CreateAccViewController>(storyboard: Wizard.self)
|
|
|
|
internal static let acceptToS = SceneType<UIKit.UIViewController>(storyboard: Wizard.self, identifier: "Accept-ToS")
|
|
|
|
internal static let createAccount = SceneType<SwiftGen.CreateAccViewController>(storyboard: Wizard.self, identifier: "CreateAccount")
|
|
|
|
internal static let preferences = SceneType<UIKit.UITableViewController>(storyboard: Wizard.self, identifier: "Preferences")
|
|
|
|
internal static let validatePassword = SceneType<ExtraModule.ValidatePasswordViewController>(storyboard: Wizard.self, identifier: "Validate_Password")
|
|
}
|
|
}
|
|
// swiftlint:enable explicit_type_interface identifier_name line_length prefer_self_in_static_references
|
|
// swiftlint:enable 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
|
|
return UIStoryboard(name: name, bundle: BundleToken.bundle)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
@available(iOS 13.0, tvOS 13.0, *)
|
|
internal func instantiate(creator block: @escaping (NSCoder) -> T?) -> T {
|
|
return storyboard.storyboard.instantiateViewController(identifier: identifier, creator: block)
|
|
}
|
|
}
|
|
|
|
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
|
|
}
|
|
|
|
@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
|
|
}
|
|
}
|
|
|
|
// swiftlint:disable convenience_type
|
|
private final class BundleToken {
|
|
static let bundle: Bundle = {
|
|
#if SWIFT_PACKAGE
|
|
return Bundle.module
|
|
#else
|
|
return Bundle(for: BundleToken.self)
|
|
#endif
|
|
}()
|
|
}
|
|
// swiftlint:enable convenience_type
|
|
// swiftlint:enable all
|