passepartout-apple/Passepartout-iOS/Global/SwiftGen+Segues.swift

67 lines
2.5 KiB
Swift
Raw Normal View History

2018-10-28 08:36:56 +00:00
// swiftlint:disable all
// 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
// swiftlint:disable file_length
// MARK: - Storyboard Segues
// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name
internal enum StoryboardSegue {
internal enum Main: String, SegueType {
case accountSegueIdentifier = "AccountSegueIdentifier"
case debugLogSegueIdentifier = "DebugLogSegueIdentifier"
case endpointSegueIdentifier = "EndpointSegueIdentifier"
case hostParametersSegueIdentifier = "HostParametersSegueIdentifier"
case networkSettingsSegueIdentifier = "NetworkSettingsSegueIdentifier"
2018-10-28 08:36:56 +00:00
case providerPoolSegueIdentifier = "ProviderPoolSegueIdentifier"
case providerPresetSegueIdentifier = "ProviderPresetSegueIdentifier"
2019-10-23 08:52:15 +00:00
case serverNetworkSegueIdentifier = "ServerNetworkSegueIdentifier"
2018-10-28 08:36:56 +00:00
}
internal enum Organizer: String, SegueType {
case aboutSegueIdentifier = "AboutSegueIdentifier"
case addProviderSegueIdentifier = "AddProviderSegueIdentifier"
2019-04-06 21:58:19 +00:00
case donateSegueIdentifier = "DonateSegueIdentifier"
2018-10-28 08:36:56 +00:00
case importHostSegueIdentifier = "ImportHostSegueIdentifier"
case selectProfileSegueIdentifier = "SelectProfileSegueIdentifier"
case showImportedHostsSegueIdentifier = "ShowImportedHostsSegueIdentifier"
2019-03-18 19:14:59 +00:00
case siriShortcutsSegueIdentifier = "SiriShortcutsSegueIdentifier"
2018-10-28 08:36:56 +00:00
}
internal enum Shortcuts: String, SegueType {
case connectToSegueIdentifier = "ConnectToSegueIdentifier"
case pickLocationSegueIdentifier = "PickLocationSegueIdentifier"
case shortcutAddSegueIdentifier = "ShortcutAddSegueIdentifier"
}
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 SegueType: RawRepresentable {}
internal extension UIViewController {
func perform<S: SegueType>(segue: S, sender: Any? = nil) where S.RawValue == String {
let identifier = segue.rawValue
performSegue(withIdentifier: identifier, sender: sender)
}
}
internal extension SegueType where RawValue == String {
init?(_ segue: UIStoryboardSegue) {
guard let identifier = segue.identifier else { return nil }
self.init(rawValue: identifier)
}
}
2020-07-07 21:34:42 +00:00
// swiftlint:disable convenience_type
private final class BundleToken {
static let bundle: Bundle = {
Bundle(for: BundleToken.self)
}()
}
// swiftlint:enable convenience_type