SwiftEntryKit
SwiftEntryKit copied to clipboard
Rotate float top view issue under iPhone X, and so on.
Describe the bug A similar question<iPhone x issue>
To Reproduce
- Code as following:
var attributes: EKAttributes
attributes = .bottomFloat
attributes.windowLevel = .alerts
attributes.hapticFeedbackType = .success
attributes.screenInteraction = .forward
attributes.entryInteraction = .absorbTouches
attributes.scroll = .enabled(swipeable: true, pullbackAnimation: .jolt)
attributes.screenBackground = .color(color: .clear)
attributes.entryBackground = .color(color: .clear)
attributes.entranceAnimation = .init(scale: .init(from: 0.9, to: 1, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 0, to: 1, duration: 0.3))
attributes.exitAnimation = .init(scale: .init(from: 1, to: 0.9, duration: 0.4, spring: .init(damping: 1, initialVelocity: 0)), fade: .init(from: 1, to: 0, duration: 0.3))
attributes.displayDuration = .infinity
attributes.border = .value(color: .black, width: 0.5)
attributes.shadow = .active(with: .init(color: .black, opacity: 0.3, radius: 5, offset: .zero))
attributes.positionConstraints.size = .init(width: .constant(value: min(UIScreen.main.bounds.width, UIScreen.main.bounds.height)), height: .intrinsic)
attributes.positionConstraints.verticalOffset = 0
attributes.positionConstraints.safeArea = .empty(fillSafeArea: false)
return attributes
-
Add the code
attributes.positionConstraints.safeArea = .overridden
-
And active the auto rotate
attributes.positionConstraints.rotation.isEnabled = true
-
When show float view, rotate screen. The view will overlay with device top.
Expected behavior The view will not overlay with device top.
iPhone (please complete the following information):
- Device: iPhone X
- iOS Version: iOS 13.4
- Xcode Version: 11.4.1
- Dependency Manager Version: CocoaPods 1.8.0
- SwiftEntryKit Release: 1.2.3
Screenshots / Video Links