simple fix
let SAFE_TOP: CGFloat = UIScreen.main.applicationFrame.height >= 792 ? 22.0 : 0
let SAFE_BOTTOM: CGFloat =UIScreen.main.applicationFrame.height >= 792 ? 34.0 : 0
for ipad use below
struct Constraints {
static var STATUS_HEIGHT: CGFloat {
if #available(iOS 11.0, *) {
let window: UIWindow = UIApplication.shared.windows[0]
let safeFrame = window.safeAreaLayoutGuide.layoutFrame
return safeFrame.minY
} else {
return 20
}
}
static var SAFE_BOTTOM: CGFloat {
if #available(iOS 11.0, *) {
let window: UIWindow = UIApplication.shared.windows[0]
let safeFrame = window.safeAreaLayoutGuide.layoutFrame
return window.frame.maxY - safeFrame.maxY
} else {
return 0
}
}
}
반응형
'iPhone' 카테고리의 다른 글
Swift Lint yml (0) | 2020.07.26 |
---|---|
AWS Simple Notification Service p12 (0) | 2020.06.10 |
Underline text / title in UIButton (0) | 2020.06.10 |
rbenv install stuck at installing openssl (0) | 2020.06.09 |
iOS10 firebase crashlytics showing NSInternalInconsistencyException (0) | 2020.06.09 |