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

invalidateLayout() is not asking delegate for new Layout object #509

Closed
asiliuk opened this issue Nov 9, 2021 · 1 comment · Fixed by #510
Closed

invalidateLayout() is not asking delegate for new Layout object #509

asiliuk opened this issue Nov 9, 2021 · 1 comment · Fixed by #510

Comments

@asiliuk
Copy link
Contributor

asiliuk commented Nov 9, 2021

Description

invalidateLayout() is not actually getting new layout object from delegate.

Documentation says:

Updates the layout object from the delegate and lays out the views managed
by the controller immediately.

This method updates the FloatingPanelLayout object from the delegate and
then it calls layoutIfNeeded() of the root view to force the view
to update the layout immediately. It can be called in an
animation block.

But based on the code and behaviour looks like that only constraints are updated, but new layout object is not asked from the delegate.

Expected behavior

One of the following delegate methods is called

func floatingPanel(_ fpc: FloatingPanelController, layoutFor newCollection: UITraitCollection) -> FloatingPanelLayout
func floatingPanel(_ fpc: FloatingPanelController, layoutFor size: CGSize) -> FloatingPanelLayout

Actual behavior

Delegate methods are not called

Steps to reproduce

Code example that reproduces the issue

How do you display panel(s)?

  • Present modally

How many panels do you displays?

  • 1

Environment

Library version:
2.5

Installation method:

  • CocoaPods

iOS version(s)
15.1

Xcode version
13.1

@scenee
Copy link
Owner

scenee commented Nov 10, 2021

Thank you so much for your mention. I will fix the method as following the doc comment. invalidateLayout() will reload the func floatingPanel(_ vc:layoutFor:) -> FloatingPanelLayout.

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

Successfully merging a pull request may close this issue.

2 participants