mirror of
https://github.com/fxm90/GradientLoadingBar.git
synced 2026-06-16 12:24:31 +00:00
🐛 :: Fix notch mask accidentally applied to iPads
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user