Remove redundant 'else' blocks

This commit is contained in:
Danny Moesch 2021-01-31 13:34:37 +01:00 committed by Mingshen Sun
parent ad4ed9419e
commit 1454693308
9 changed files with 22 additions and 57 deletions

View file

@ -13,32 +13,28 @@ extension UIView {
var safeTopAnchor: NSLayoutYAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.topAnchor
} else {
return topAnchor
}
return topAnchor
}
var safeLeftAnchor: NSLayoutXAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.leftAnchor
} else {
return leftAnchor
}
return leftAnchor
}
var safeRightAnchor: NSLayoutXAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.rightAnchor
} else {
return rightAnchor
}
return rightAnchor
}
var safeBottomAnchor: NSLayoutYAxisAnchor {
if #available(iOS 11.0, *) {
return self.safeAreaLayoutGuide.bottomAnchor
} else {
return bottomAnchor
}
return bottomAnchor
}
}