From 589bba60b15300a6fd2e4f2a5a97bdf7b23ec736 Mon Sep 17 00:00:00 2001 From: Jeroen Leenarts Date: Tue, 2 Oct 2018 19:53:56 +0200 Subject: [PATCH] Deal with type body length warning. Signed-off-by: Jason A. Donenfeld --- WireGuard/Coordinators/AppCoordinator.swift | 38 +++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/WireGuard/Coordinators/AppCoordinator.swift b/WireGuard/Coordinators/AppCoordinator.swift index 9554b33..07f8aa1 100644 --- a/WireGuard/Coordinators/AppCoordinator.swift +++ b/WireGuard/Coordinators/AppCoordinator.swift @@ -22,7 +22,7 @@ extension UINavigationController: Identifyable {} let APPGROUP = "group.com.wireguard.ios" let VPNBUNDLE = "com.wireguard.ios.network-extension" -class AppCoordinator: RootViewCoordinator { +class AppCoordinator: RootViewCoordinator { // swiftlint:disable:this type_body_length let persistentContainer = NSPersistentContainer(name: "WireGuard") let storyboard = UIStoryboard(name: "Main", bundle: nil) @@ -400,23 +400,6 @@ class AppCoordinator: RootViewCoordinator { self.navigationController.present(alert, animated: true) } - private func description(for status: NEVPNStatus) -> String { - switch status { - case .connected: - return "Connected" - case .connecting: - return "Connecting" - case .disconnected: - return "Disconnected" - case .disconnecting: - return "Disconnecting" - case .invalid: - return "Invalid" - case .reasserting: - return "Reasserting" - } - } - func providerManager(for tunnel: Tunnel) -> NETunnelProviderManager? { return self.providerManagers?.first { guard let prot = $0.protocolConfiguration as? NETunnelProviderProtocol else { @@ -450,3 +433,22 @@ class AppDocumentPickerDelegate: NSObject, UIDocumentPickerDelegate { } } + +extension NEVPNStatus { + var statusDescription: String { + switch self { + case .connected: + return "Connected" + case .connecting: + return "Connecting" + case .disconnected: + return "Disconnected" + case .disconnecting: + return "Disconnecting" + case .invalid: + return "Invalid" + case .reasserting: + return "Reasserting" + } + } +}