diff options
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift index 1746c81..7d134de 100644 --- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift +++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift @@ -4,14 +4,9 @@ import UIKit import os.log -class ErrorPresenter { - static func showErrorAlert(error: WireGuardAppError, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) { - let (title, message) = error.alertText - showErrorAlert(title: title, message: message, from: sourceVC, onPresented: onPresented, onDismissal: onDismissal) - } - - static func showErrorAlert(title: String, message: String, from sourceVC: UIViewController?, onPresented: (() -> Void)? = nil, onDismissal: (() -> Void)? = nil) { - guard let sourceVC = sourceVC else { return } +class ErrorPresenter: ErrorPresenterProtocol { + static func showErrorAlert(title: String, message: String, from sourceVC: AnyObject?, onPresented: (() -> Void)?, onDismissal: (() -> Void)?) { + guard let sourceVC = sourceVC as? UIViewController else { return } let okAction = UIAlertAction(title: "OK", style: .default) { _ in onDismissal?() |