passepartout-apple/Passepartout/App/macOS/Global/SwiftGen+Segues.swift

48 lines
1.6 KiB
Swift
Raw Normal View History

// swiftlint:disable all
// Generated using SwiftGen https://github.com/SwiftGen/SwiftGen
// swiftlint:disable sorted_imports
import Foundation
import AppKit
// 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 enterAccountSegueIdentifier = "EnterAccountSegueIdentifier"
case renameProfileSegueIdentifier = "RenameProfileSegueIdentifier"
}
internal enum Service: String, SegueType {
case accountSegueIdentifier = "AccountSegueIdentifier"
case customizeSegueIdentifier = "CustomizeSegueIdentifier"
case trustedNetworkAddSegueIdentifier = "TrustedNetworkAddSegueIdentifier"
}
}
// swiftlint:enable explicit_type_interface identifier_name line_length type_body_length type_name
// MARK: - Implementation Details
internal protocol SegueType: RawRepresentable {}
internal extension NSSeguePerforming {
func perform<S: SegueType>(segue: S, sender: Any? = nil) where S.RawValue == String {
let identifier = NSStoryboardSegue.Identifier(segue.rawValue)
performSegue?(withIdentifier: identifier, sender: sender)
}
}
internal extension SegueType where RawValue == String {
init?(_ segue: NSStoryboardSegue) {
#if swift(>=4.2)
guard let identifier = segue.identifier else { return nil }
#else
guard let identifier = segue.identifier?.rawValue else { return nil }
#endif
self.init(rawValue: identifier)
}
}