Skip to content
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

OverlayViewController is not layout before animation when set before moveOverlay(toNotchAt:animated:) #49

Closed
denisPoifol opened this issue Nov 8, 2019 · 0 comments

Comments

@denisPoifol
Copy link
Contributor

When setting the viewControllers property just before animating appearance of the overlay :

overlayContainerViewController.viewControllers = [
    mainViewController,
    backdropViewController,
    overlayViewController,
].compactMap { $0 }
overlayContainerViewController.moveOverlay(to: .medium, animated: true)

We end up with the overlayViewcontroller being animated in its height like it should, but also in its width because its view did not layout properly before the begining of the animation.

I could make this work by forcing the layout of the superview of the overlayViewController, but it is a hacky solution, and it would definitely be better if the pod handled this force layout on its own :

overlayContainerViewController.viewControllers = [
    mainViewController,
    backdropViewController,
    overlayViewController,
].compactMap { $0 }
overlayViewController?.view.superview?.setNeedsLayout()
overlayViewController?.view.superview?.layoutIfNeeded()
overlayContainerViewController.moveOverlay(to: .medium, animated: true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant