Remove branches for iOS 12 compatibility

This commit is contained in:
Mingshen Sun 2023-02-04 15:27:37 -08:00
parent 7000834575
commit b09bc7444f
7 changed files with 17 additions and 59 deletions

View file

@ -35,9 +35,7 @@ class PGPKeyFileImportTableViewController: AutoCellHeightUITableViewController,
return
}
picker.delegate = self
if #available(iOS 13.0, *) {
picker.shouldShowFileExtensions = true
}
picker.shouldShowFileExtensions = true
present(picker, animated: true, completion: nil)
}
}

View file

@ -550,17 +550,9 @@ extension PasswordDetailTableViewController {
switch error {
case let .yubiKey(yubiKeyError):
let errorMessage = yubiKeyError.localizedDescription
if #available(iOS 13.0, *) {
YubiKitManager.shared.stopNFCConnection(withErrorMessage: errorMessage)
DispatchQueue.main.async {
self.navigationController?.popViewController(animated: true)
}
} else {
DispatchQueue.main.async {
self.presentFailureAlert(message: errorMessage) { _ in
self.navigationController?.popViewController(animated: true)
}
}
YubiKitManager.shared.stopNFCConnection(withErrorMessage: errorMessage)
DispatchQueue.main.async {
self.navigationController?.popViewController(animated: true)
}
default:
DispatchQueue.main.async {

View file

@ -34,9 +34,7 @@ class PasswordNavigationViewController: UIViewController {
uiSearchController.obscuresBackgroundDuringPresentation = false
uiSearchController.searchBar.sizeToFit()
uiSearchController.searchBar.returnKeyType = .done
if #available(iOS 13.0, *) {
uiSearchController.searchBar.searchTextField.clearButtonMode = .whileEditing
}
uiSearchController.searchBar.searchTextField.clearButtonMode = .whileEditing
return uiSearchController
}()
@ -50,15 +48,11 @@ class PasswordNavigationViewController: UIViewController {
lazy var addPasswordUIBarButtonItem: UIBarButtonItem = {
var addPasswordUIBarButtonItem = UIBarButtonItem()
if #available(iOS 13.0, *) {
let addPasswordButton = UIButton(type: .system)
let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
addPasswordButton.setImage(plusImage, for: .normal)
addPasswordButton.addTarget(self, action: #selector(self.addPasswordAction), for: .touchDown)
addPasswordUIBarButtonItem.customView = addPasswordButton
} else {
addPasswordUIBarButtonItem = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(self.addPasswordAction))
}
let addPasswordButton = UIButton(type: .system)
let plusImage = UIImage(systemName: "plus.circle", withConfiguration: UIImage.SymbolConfiguration(weight: .regular))
addPasswordButton.setImage(plusImage, for: .normal)
addPasswordButton.addTarget(self, action: #selector(self.addPasswordAction), for: .touchDown)
addPasswordUIBarButtonItem.customView = addPasswordButton
return addPasswordUIBarButtonItem
}()

View file

@ -27,9 +27,7 @@ class SSHKeyFileImportTableViewController: AutoCellHeightUITableViewController {
return
}
picker.delegate = self
if #available(iOS 13.0, *) {
picker.shouldShowFileExtensions = true
}
picker.shouldShowFileExtensions = true
present(picker, animated: true, completion: nil)
}
}