Sfoglia il codice sorgente

VLCAlertViewController: Cosmetic

Soomin Lee 6 anni fa
parent
commit
3589682a94
1 ha cambiato i file con 20 aggiunte e 6 eliminazioni
  1. 20 6
      SharedSources/VLCAlertViewController.swift

+ 20 - 6
SharedSources/VLCAlertViewController.swift

@@ -32,19 +32,31 @@ typealias AlertAction = (UIAlertAction) -> Void
 
 @objcMembers class VLCAlertViewController: UIAlertController {
 
-    class func alertViewManager(title: String, errorMessage: String? = nil, viewController: UIViewController) {
-        VLCAlertViewController.alertViewManager(title: title, errorMessage: errorMessage, viewController: viewController, buttonsAction: nil)
+    class func alertViewManager(title: String,
+                                errorMessage: String? = nil,
+                                viewController: UIViewController) {
+        VLCAlertViewController.alertViewManager(title: title,
+                                                errorMessage: errorMessage,
+                                                viewController: viewController,
+                                                buttonsAction: nil)
     }
 
-    class func alertViewManager(title: String, errorMessage: String? = nil, viewController: UIViewController, buttonsAction: [VLCAlertButton]?) {
+    class func alertViewManager(title: String,
+                                errorMessage: String? = nil,
+                                viewController: UIViewController,
+                                buttonsAction: [VLCAlertButton]?) {
         let alert = UIAlertController(title: title, message: errorMessage, preferredStyle: .alert)
         if let buttonsAction = buttonsAction {
             for buttonAction in buttonsAction {
-                let action = UIAlertAction(title: buttonAction.title, style: buttonAction.style, handler: buttonAction.action)
+                let action = UIAlertAction(title: buttonAction.title,
+                                           style: buttonAction.style,
+                                           handler: buttonAction.action)
                 alert.addAction(action)
             }
         } else {
-            let action = UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment:""), style: UIAlertActionStyle.default, handler: nil)
+            let action = UIAlertAction(title: NSLocalizedString("BUTTON_OK", comment:""),
+                                       style: .default,
+                                       handler: nil)
             alert.addAction(action)
         }
         alert.show(viewController, sender: Any?.self)
@@ -62,7 +74,9 @@ typealias AlertAction = (UIAlertAction) -> Void
             textField.text = textFieldText
         })
         for buttonAction in buttonsAction {
-            let action = UIAlertAction(title: buttonAction.title, style: buttonAction.style, handler: buttonAction.action)
+            let action = UIAlertAction(title: buttonAction.title,
+                                       style: buttonAction.style,
+                                       handler: buttonAction.action)
             alert.addAction(action)
         }
         alert.show(viewController, sender: Any?.self)