-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to manage safe area constraints on presented view controller during interactive presentation? #169
Comments
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
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 codeLThe text was updated successfully, but these errors were encountered: