Open bernikovich opened 5 years ago
First screenshot shows normal behavior. Second one with issue during interactive dismissal.
SafeArea guide changes without animation. So user can see blink when my red view changes its place.
Hi, try to replace calculateCenterPoint func in ModalCenterPosition file on:
func calculateCenterPoint(_ containerFrame: CGRect) -> CGPoint? {
var bottom: CGFloat = 0
var top: CGFloat = 0
if #available(iOS 11.0, *), let keyWindow = UIApplication.shared.keyWindow {
if keyWindow.safeAreaInsets.bottom > 0 && keyWindow.safeAreaInsets.top > 0 {
top = keyWindow.safeAreaInsets.top
bottom = keyWindow.safeAreaInsets.bottom
}
}
switch self {
case .center:
return CGPoint(x: containerFrame.origin.x + (containerFrame.width / 2),
y: containerFrame.origin.y + (containerFrame.height / 2))
case .topCenter:
return CGPoint(x: containerFrame.origin.x + (containerFrame.width / 2),
y: containerFrame.origin.y + (containerFrame.height * (1 / 4) - 1) + top)
case .bottomCenter:
return CGPoint(x: containerFrame.origin.x + (containerFrame.width / 2),
y: containerFrame.origin.y + (containerFrame.height * (3 / 4)) - bottom)
case .custom(let point):
return point
case .customOrigin(_):
return nil
}
}
Hello guys. I have faced with an issue related to safe area during interactive presentation. Does someone knows how to fix it?
I have added in PresentrExample.MainTableViewController ->
lazy var alertViewController
following codeL