Commit f707363f authored by Davide De Rosa's avatar Davide De Rosa
Browse files

Suppress SwiftGen updates

parent 0a3413e6
......@@ -7,22 +7,22 @@ import UIKit
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_length
protocol StoryboardType {
internal protocol StoryboardType {
static var storyboardName: String { get }
}
extension StoryboardType {
internal extension StoryboardType {
static var storyboard: UIStoryboard {
let name = self.storyboardName
return UIStoryboard(name: name, bundle: Bundle(for: BundleToken.self))
}
}
struct SceneType<T: Any> {
let storyboard: StoryboardType.Type
let identifier: String
internal struct SceneType<T: Any> {
internal let storyboard: StoryboardType.Type
internal let identifier: String
func instantiate() -> T {
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).")
......@@ -31,10 +31,10 @@ struct SceneType<T: Any> {
}
}
struct InitialSceneType<T: Any> {
let storyboard: StoryboardType.Type
internal struct InitialSceneType<T: Any> {
internal let storyboard: StoryboardType.Type
func instantiate() -> T {
internal func instantiate() -> T {
guard let controller = storyboard.storyboard.instantiateInitialViewController() as? T else {
fatalError("ViewController is not of the expected class \(T.self).")
}
......@@ -42,9 +42,9 @@ struct InitialSceneType<T: Any> {
}
}
protocol SegueType: RawRepresentable { }
internal protocol SegueType: RawRepresentable { }
extension UIViewController {
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)
......@@ -52,18 +52,18 @@ extension UIViewController {
}
// swiftlint:disable explicit_type_interface identifier_name line_length type_body_length type_name
enum StoryboardScene {
enum Main: StoryboardType {
static let storyboardName = "Main"
internal enum StoryboardScene {
internal enum Main: StoryboardType {
internal static let storyboardName = "Main"
static let initialScene = InitialSceneType<UINavigationController>(storyboard: Main.self)
internal static let initialScene = InitialSceneType<UINavigationController>(storyboard: Main.self)
static let vpnPermissionViewController = SceneType<PIA_VPN.VPNPermissionViewController>(storyboard: Main.self, identifier: "VPNPermissionViewController")
internal static let vpnPermissionViewController = SceneType<PIA_VPN.VPNPermissionViewController>(storyboard: Main.self, identifier: "VPNPermissionViewController")
}
}
enum StoryboardSegue {
enum Main: String, SegueType {
internal enum StoryboardSegue {
internal enum Main: String, SegueType {
case aboutSegueIdentifier = "AboutSegueIdentifier"
case accountSegueIdentifier = "AccountSegueIdentifier"
case contentBlockerSegueIdentifier = "ContentBlockerSegueIdentifier"
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment