Remove availability checks for iOS 11.0 (#486)

This commit is contained in:
Danny Mösch 2021-08-16 21:59:46 +02:00 committed by GitHub
parent 7bd860cbe5
commit a83acd096a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 20 deletions

View file

@ -58,9 +58,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
editUIBarButtonItem.isEnabled = false
navigationItem.rightBarButtonItem = editUIBarButtonItem
if #available(iOS 11.0, *) {
navigationItem.largeTitleDisplayMode = .never
}
if let imageData = passwordEntity?.getImage() {
let image = UIImage(data: imageData as Data)

View file

@ -55,7 +55,7 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
let myContext = LAContext()
var authError: NSError?
if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
if #available(iOS 11.0, *), myContext.biometryType == .faceID {
if myContext.biometryType == .faceID {
biometryAuthButton.setTitle("FaceId".localize(), for: .normal)
} else {
biometryAuthButton.setTitle("TouchId".localize(), for: .normal)

View file

@ -11,30 +11,18 @@ import Foundation
extension UIView {
// Save anchors: https://stackoverflow.com/questions/46317061/use-safe-area-layout-programmatically
var safeTopAnchor: NSLayoutYAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.topAnchor
}
return topAnchor
safeAreaLayoutGuide.topAnchor
}
var safeLeftAnchor: NSLayoutXAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.leftAnchor
}
return leftAnchor
safeAreaLayoutGuide.leftAnchor
}
var safeRightAnchor: NSLayoutXAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.rightAnchor
}
return rightAnchor
safeAreaLayoutGuide.rightAnchor
}
var safeBottomAnchor: NSLayoutYAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.bottomAnchor
}
return bottomAnchor
safeAreaLayoutGuide.bottomAnchor
}
}