From a4845bf0a15c71873eeef6db031d913b620fa80c Mon Sep 17 00:00:00 2001 From: Alexander Rutsman Date: Mon, 15 Nov 2021 18:50:28 +0300 Subject: [PATCH] refactor: creating alerts --- .../Sources/Views/Alert/Factories/AlertFactory.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/TIUIElements/Sources/Views/Alert/Factories/AlertFactory.swift b/TIUIElements/Sources/Views/Alert/Factories/AlertFactory.swift index 9ca0d055..ca20e0e4 100644 --- a/TIUIElements/Sources/Views/Alert/Factories/AlertFactory.swift +++ b/TIUIElements/Sources/Views/Alert/Factories/AlertFactory.swift @@ -32,11 +32,8 @@ public enum AlertFactory { controller.view.tintColor = descriptor.tintColor - for action in descriptor.actions { - let alertAction = UIAlertAction(title: action.title, style: action.style) { _ in - action.closure?() - } - controller.addAction(alertAction) + descriptor.actions.forEach { + controller.addAction($0) } return controller