-
-
Notifications
You must be signed in to change notification settings - Fork 531
Allow animated FloatingPanelController relayout #208
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
base: master
Are you sure you want to change the base?
Conversation
Sounds great! I will check this more detail later. |
# Conflicts: # Framework/Sources/FloatingPanelLayout.swift
|
Hello @scenee. The pull request has been updated with the most recent changes from version 1.6.0. |
|
Please tell me if you'd like some tests to be added, or if you wonder how to trigger the constraint issues that this PR is solving. |
Yes, I would! And could you please check we're able to use the new APIs like this? func updateLayoutOfPanelParent() {
UIView.animate(withDuration: 0.25, animations: {
// 1. Begin panel update
self.panel.beginUpdateLayout()
// 2. Update layout of panel’s parent
…
// 3. End panel update
self.panel.endUpdateLayout()
})
} |
|
Sure, @scenee, I will 👍 |
fdf8181 to
d517720
Compare
Hello,
This PR introduces two new methods on FloatingPanelController: beginUpdateLayout(), and endUpdateLayout(). They extend the existing updateLayout() method, and allow applications to transition from one set of constraints to another without facing undesired "Unable to simultaneously satisfy constraints" errors.
My understanding is that those errors happen when the parent controller of the panel wants to change height, because of conflicts with the hard FloatingPanelLayoutAdapter.heightConstraint.
For example, this happens when the panel is embedded in a view controller which is not always fullscreen.
This PR lets the host application play a three-steps game:
Usage:
This PR may also address #160, but I'm not sure.