From 73c708d9028e8dada52c69e45e02b9d2255adbec Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Mon, 2 Aug 2021 13:46:06 +0530 Subject: [PATCH] build: Fix swift warnings Use 'AnyObject' instead of 'class' to restrict protocol inheritance Signed-off-by: Roopesh Chander --- Sources/WireGuardApp/Tunnel/TunnelsManager.swift | 4 ++-- .../UI/iOS/ViewController/QRScanViewController.swift | 2 +- .../ViewController/SSIDOptionEditTableViewController.swift | 2 +- .../UI/iOS/ViewController/TunnelEditTableViewController.swift | 2 +- Sources/WireGuardApp/UI/macOS/StatusMenu.swift | 2 +- .../UI/macOS/ViewController/TunnelEditViewController.swift | 2 +- .../macOS/ViewController/TunnelsListTableViewController.swift | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/WireGuardApp/Tunnel/TunnelsManager.swift b/Sources/WireGuardApp/Tunnel/TunnelsManager.swift index 2865f7a..fe3955b 100644 --- a/Sources/WireGuardApp/Tunnel/TunnelsManager.swift +++ b/Sources/WireGuardApp/Tunnel/TunnelsManager.swift @@ -5,14 +5,14 @@ import Foundation import NetworkExtension import os.log -protocol TunnelsManagerListDelegate: class { +protocol TunnelsManagerListDelegate: AnyObject { func tunnelAdded(at index: Int) func tunnelModified(at index: Int) func tunnelMoved(from oldIndex: Int, to newIndex: Int) func tunnelRemoved(at index: Int, tunnel: TunnelContainer) } -protocol TunnelsManagerActivationDelegate: class { +protocol TunnelsManagerActivationDelegate: AnyObject { func tunnelActivationAttemptFailed(tunnel: TunnelContainer, error: TunnelsManagerActivationAttemptError) // startTunnel wasn't called or failed func tunnelActivationAttemptSucceeded(tunnel: TunnelContainer) // startTunnel succeeded func tunnelActivationFailed(tunnel: TunnelContainer, error: TunnelsManagerActivationError) // status didn't change to connected diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift index 601f7b8..4be0d67 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/QRScanViewController.swift @@ -4,7 +4,7 @@ import AVFoundation import UIKit -protocol QRScanViewControllerDelegate: class { +protocol QRScanViewControllerDelegate: AnyObject { func addScannedQRCode(tunnelConfiguration: TunnelConfiguration, qrScanViewController: QRScanViewController, completionHandler: (() -> Void)?) } diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift index 56a3447..a3647c3 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SSIDOptionEditTableViewController.swift @@ -5,7 +5,7 @@ import UIKit import SystemConfiguration.CaptiveNetwork import NetworkExtension -protocol SSIDOptionEditTableViewControllerDelegate: class { +protocol SSIDOptionEditTableViewControllerDelegate: AnyObject { func ssidOptionSaved(option: ActivateOnDemandViewModel.OnDemandSSIDOption, ssids: [String]) } diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift index e619a8a..e4d94d3 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/TunnelEditTableViewController.swift @@ -3,7 +3,7 @@ import UIKit -protocol TunnelEditTableViewControllerDelegate: class { +protocol TunnelEditTableViewControllerDelegate: AnyObject { func tunnelSaved(tunnel: TunnelContainer) func tunnelEditingCancelled() } diff --git a/Sources/WireGuardApp/UI/macOS/StatusMenu.swift b/Sources/WireGuardApp/UI/macOS/StatusMenu.swift index 79d0cbc..6cd00a4 100644 --- a/Sources/WireGuardApp/UI/macOS/StatusMenu.swift +++ b/Sources/WireGuardApp/UI/macOS/StatusMenu.swift @@ -3,7 +3,7 @@ import Cocoa -protocol StatusMenuWindowDelegate: class { +protocol StatusMenuWindowDelegate: AnyObject { func showManageTunnelsWindow(completion: ((NSWindow?) -> Void)?) } diff --git a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelEditViewController.swift b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelEditViewController.swift index 139b00e..c1f7c74 100644 --- a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelEditViewController.swift +++ b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelEditViewController.swift @@ -3,7 +3,7 @@ import Cocoa -protocol TunnelEditViewControllerDelegate: class { +protocol TunnelEditViewControllerDelegate: AnyObject { func tunnelSaved(tunnel: TunnelContainer) func tunnelEditingCancelled() } diff --git a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelsListTableViewController.swift b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelsListTableViewController.swift index e1fd1e8..7c94dbb 100644 --- a/Sources/WireGuardApp/UI/macOS/ViewController/TunnelsListTableViewController.swift +++ b/Sources/WireGuardApp/UI/macOS/ViewController/TunnelsListTableViewController.swift @@ -3,7 +3,7 @@ import Cocoa -protocol TunnelsListTableViewControllerDelegate: class { +protocol TunnelsListTableViewControllerDelegate: AnyObject { func tunnelsSelected(tunnelIndices: [Int]) func tunnelsListEmpty() }