Remove availability checks for iOS 11.0 (#486)
This commit is contained in:
parent
7bd860cbe5
commit
a83acd096a
3 changed files with 6 additions and 20 deletions
|
|
@ -58,9 +58,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
|
||||||
|
|
||||||
editUIBarButtonItem.isEnabled = false
|
editUIBarButtonItem.isEnabled = false
|
||||||
navigationItem.rightBarButtonItem = editUIBarButtonItem
|
navigationItem.rightBarButtonItem = editUIBarButtonItem
|
||||||
if #available(iOS 11.0, *) {
|
|
||||||
navigationItem.largeTitleDisplayMode = .never
|
navigationItem.largeTitleDisplayMode = .never
|
||||||
}
|
|
||||||
|
|
||||||
if let imageData = passwordEntity?.getImage() {
|
if let imageData = passwordEntity?.getImage() {
|
||||||
let image = UIImage(data: imageData as Data)
|
let image = UIImage(data: imageData as Data)
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ open class PasscodeLockViewController: UIViewController, UITextFieldDelegate {
|
||||||
let myContext = LAContext()
|
let myContext = LAContext()
|
||||||
var authError: NSError?
|
var authError: NSError?
|
||||||
if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
|
if myContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &authError) {
|
||||||
if #available(iOS 11.0, *), myContext.biometryType == .faceID {
|
if myContext.biometryType == .faceID {
|
||||||
biometryAuthButton.setTitle("FaceId".localize(), for: .normal)
|
biometryAuthButton.setTitle("FaceId".localize(), for: .normal)
|
||||||
} else {
|
} else {
|
||||||
biometryAuthButton.setTitle("TouchId".localize(), for: .normal)
|
biometryAuthButton.setTitle("TouchId".localize(), for: .normal)
|
||||||
|
|
|
||||||
|
|
@ -11,30 +11,18 @@ import Foundation
|
||||||
extension UIView {
|
extension UIView {
|
||||||
// Save anchors: https://stackoverflow.com/questions/46317061/use-safe-area-layout-programmatically
|
// Save anchors: https://stackoverflow.com/questions/46317061/use-safe-area-layout-programmatically
|
||||||
var safeTopAnchor: NSLayoutYAxisAnchor {
|
var safeTopAnchor: NSLayoutYAxisAnchor {
|
||||||
if #available(iOS 11.0, *) {
|
safeAreaLayoutGuide.topAnchor
|
||||||
return self.safeAreaLayoutGuide.topAnchor
|
|
||||||
}
|
|
||||||
return topAnchor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var safeLeftAnchor: NSLayoutXAxisAnchor {
|
var safeLeftAnchor: NSLayoutXAxisAnchor {
|
||||||
if #available(iOS 11.0, *) {
|
safeAreaLayoutGuide.leftAnchor
|
||||||
return self.safeAreaLayoutGuide.leftAnchor
|
|
||||||
}
|
|
||||||
return leftAnchor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var safeRightAnchor: NSLayoutXAxisAnchor {
|
var safeRightAnchor: NSLayoutXAxisAnchor {
|
||||||
if #available(iOS 11.0, *) {
|
safeAreaLayoutGuide.rightAnchor
|
||||||
return self.safeAreaLayoutGuide.rightAnchor
|
|
||||||
}
|
|
||||||
return rightAnchor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var safeBottomAnchor: NSLayoutYAxisAnchor {
|
var safeBottomAnchor: NSLayoutYAxisAnchor {
|
||||||
if #available(iOS 11.0, *) {
|
safeAreaLayoutGuide.bottomAnchor
|
||||||
return self.safeAreaLayoutGuide.bottomAnchor
|
|
||||||
}
|
|
||||||
return bottomAnchor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue