🐛 :: Fix notch mask accidentally applied to iPads

This commit is contained in:
Felix Mau
2021-05-10 20:00:33 +02:00
parent 55e1ceb5e4
commit 14d26338b9
@@ -39,7 +39,12 @@ open class NotchGradientLoadingBarController: GradientLoadingBarController {
// The `safeAreaInsets.top` always includes the status-bar and therefore will always be greater "0".
// As a workaround we check the bottom inset.
let hasNotch = superview.safeAreaInsets.bottom > 0
guard hasNotch else {
// The iPad also has a bottom inset, in order to avoid the home indicator. (https://developer.apple.com/forums/thread/110724)
// As a workaround we explicitly make sure to have a phone device.
let isIPhone = UIDevice.current.userInterfaceIdiom == .phone
guard hasNotch, isIPhone else {
// No special masking required for non safe area devices.
super.setupConstraints(superview: superview)
return