56 lines
1.8 KiB
Swift
56 lines
1.8 KiB
Swift
// 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)
|
|
}
|
|
}
|
|
|
|
// swiftlint:disable convenience_type
|
|
private final class BundleToken {
|
|
static let bundle: Bundle = {
|
|
Bundle(for: BundleToken.self)
|
|
}()
|
|
}
|
|
// swiftlint:enable convenience_type
|