Show error in alert instead of HUD

This commit is contained in:
Bob Sun 2017-03-16 23:12:31 -07:00
parent d2cff20131
commit 0ad9713fc0
No known key found for this signature in database
GPG key ID: 1F86BA2052FED3B4
5 changed files with 10 additions and 18 deletions

View file

@ -10,6 +10,7 @@ import Foundation
import SwiftyUserDefaults
import KeychainAccess
import UIKit
import SVProgressHUD
class Utils {
static func removeFileIfExists(atPath path: String) {
@ -65,6 +66,7 @@ class Utils {
}
static func alert(title: String, message: String, controller: UIViewController, completion: (() -> Void)?) {
SVProgressHUD.dismiss()
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
controller.present(alert, animated: true, completion: completion)