Format code with SwiftFormat automatically in every build
This commit is contained in:
parent
f167ab7549
commit
7f9f0e43b2
100 changed files with 1124 additions and 1063 deletions
|
|
@ -7,12 +7,12 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import SVProgressHUD
|
||||
import passKit
|
||||
import SVProgressHUD
|
||||
|
||||
public func requestGitCredentialPassword(credential: GitCredential.Credential,
|
||||
lastPassword: String?,
|
||||
controller: UIViewController) -> String? {
|
||||
lastPassword: String?,
|
||||
controller: UIViewController) -> String? {
|
||||
let sem = DispatchSemaphore(value: 0)
|
||||
var password: String?
|
||||
let message: String = {
|
||||
|
|
@ -27,21 +27,21 @@ public func requestGitCredentialPassword(credential: GitCredential.Credential,
|
|||
DispatchQueue.main.async {
|
||||
SVProgressHUD.dismiss()
|
||||
let alert = UIAlertController(title: "Password".localize(), message: message, preferredStyle: .alert)
|
||||
alert.addTextField() {
|
||||
alert.addTextField {
|
||||
$0.text = lastPassword ?? ""
|
||||
$0.isSecureTextEntry = true
|
||||
}
|
||||
alert.addAction(UIAlertAction.ok() { _ in
|
||||
alert.addAction(UIAlertAction.ok { _ in
|
||||
password = alert.textFields?.first?.text
|
||||
sem.signal()
|
||||
})
|
||||
alert.addAction(UIAlertAction.cancel() { _ in
|
||||
alert.addAction(UIAlertAction.cancel { _ in
|
||||
password = nil
|
||||
sem.signal()
|
||||
})
|
||||
controller.present(alert, animated: true)
|
||||
}
|
||||
|
||||
let _ = sem.wait(timeout: .distantFuture)
|
||||
_ = sem.wait(timeout: .distantFuture)
|
||||
return password
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class SecurePasteboard {
|
|||
// exit the existing background task, if any
|
||||
if backgroundTaskID != UIBackgroundTaskIdentifier.invalid {
|
||||
UIApplication.shared.endBackgroundTask(UIBackgroundTaskIdentifier.invalid)
|
||||
self.backgroundTaskID = UIBackgroundTaskIdentifier.invalid
|
||||
backgroundTaskID = UIBackgroundTaskIdentifier.invalid
|
||||
}
|
||||
|
||||
backgroundTaskID = UIApplication.shared.beginBackgroundTask(expirationHandler: { [weak self] in
|
||||
|
|
@ -40,5 +40,4 @@ class SecurePasteboard {
|
|||
self?.backgroundTaskID = UIBackgroundTaskIdentifier.invalid
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
//
|
||||
|
||||
import Foundation
|
||||
import SVProgressHUD
|
||||
import passKit
|
||||
import SVProgressHUD
|
||||
|
||||
extension Utils {
|
||||
static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue