From 147736373cb8f322a40dcb216c93c9df1c6fd1d1 Mon Sep 17 00:00:00 2001 From: Jungpyo Hong <54448459+jphong1111@users.noreply.github.com> Date: Wed, 5 May 2021 12:27:08 -0500 Subject: [PATCH] Delete AlertProtocol.swift --- Helper/AlertProtocol.swift | 45 -------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 Helper/AlertProtocol.swift diff --git a/Helper/AlertProtocol.swift b/Helper/AlertProtocol.swift deleted file mode 100644 index dea2103..0000000 --- a/Helper/AlertProtocol.swift +++ /dev/null @@ -1,45 +0,0 @@ -// -// AlertProtocol.swift -// VariousManagerDemoApp -// -// Created by JungpyoHong on 4/21/21. -// - -import UIKit - -enum AlertButton: String { - case ok - case cancel - case delete - case settings -} - -protocol AlertProtocol: UIViewController { - func showAlert(title: String, message: String, buttons: [AlertButton], completion: @escaping (UIAlertController, AlertButton) -> Void) -} - -extension AlertProtocol { - - func showAlert(title: String, message: String, buttons: [AlertButton] = [.ok], completion: @escaping (UIAlertController, AlertButton) -> Void) { - - let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) - - buttons.forEach { button in - let action = UIAlertAction(title: button.rawValue.capitalized, style: button == .delete ? .destructive : .default) { [alert, button] _ in - completion(alert, button) - } - alert.addAction(action) - } - self.present(alert, animated: true, completion: nil) - } -} - -protocol CellReusable { - static var identifier: String { get } -} - -extension CellReusable { - static var identifier: String { - String(describing: self) - } -}