Fix some "linking against dylib" warning

- Move requestGitPassword to view controllers
- Move Utils.alert out of passKit, because SVProgressHUD is there
This commit is contained in:
Yishi Lin 2017-06-13 13:19:18 +08:00
parent 86a6fb6395
commit 7f6900b7cd
7 changed files with 112 additions and 65 deletions

View file

@ -9,8 +9,6 @@
import Foundation
import SwiftyUserDefaults
import KeychainAccess
import UIKit
import SVProgressHUD
public class Utils {
public static func removeFileIfExists(atPath path: String) {
@ -64,13 +62,6 @@ public class Utils {
return randomString
}
public static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
SVProgressHUD.dismiss()
let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: handler))
controller.present(alert, animated: true, completion: completion)
}
public static func getPasswordFromKeychain(name: String) -> String? {
let keychain = Keychain(service: Globals.bundleIdentifier)
do {