Allow animated FloatingPanelController relayout#208
Open
groue wants to merge 4 commits intoscenee:masterfrom
Open
Allow animated FloatingPanelController relayout#208groue wants to merge 4 commits intoscenee:masterfrom
groue wants to merge 4 commits intoscenee:masterfrom
Conversation
Owner
Sounds great! I will check this more detail later. |
# Conflicts: # Framework/Sources/FloatingPanelLayout.swift
Author
|
Hello @scenee. The pull request has been updated with the most recent changes from version 1.6.0. |
Author
|
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. |
Owner
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()
})
} |
Author
|
Sure, @scenee, I will 👍 |
fdf8181 to
d517720
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.