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

Issues after migrating to 2.0 #609

Open
egk2374 opened this issue Sep 22, 2023 · 1 comment
Open

Issues after migrating to 2.0 #609

egk2374 opened this issue Sep 22, 2023 · 1 comment

Comments

@egk2374
Copy link

egk2374 commented Sep 22, 2023

Description

I know I'm a bit late on the upgrade, but xcode 15 forced me to upgrade from 1.7. I followed the 2.0 migration guide which got all of my code compiling again, however I'm having a few issues trying to get the same behavior as before. I will admit that I did not write the original code with version 1.7, but I'm trying to figure out if I missed a step when migrating to 2.0 or if I messed up something else during the migration.

Expected behavior (how it behaved in 1.7 and what I'm trying to achieve in 2.0)

Swiping the floating panel should move between tip, half, and full. In full, there is a downward pointing chevron. Swiping it down when in full should only allow the panel to go to half, swiping down from half should only go to tip, swiping down from tip should make the floating panel disappear and the screen resumes showing the parent view normally.

Actual behavior

The "one stage at a time" restriction is gone - I can swipe directly from tip to full, and from full to completely gone. Regardless of the current state, the icon at the top of the floating panel remains a flat line and never changes to a chevron. When I swipe the floating panel away, the parent view remains "grayed out" until I tap on it once.

All I've changed is the compatibility requirements for version 2.0 that are explained in the migration guide. I have not made any other changes to my codebase. I know I haven't provided much help in terms of what my code looks like, but any advice as to how to address these behavior discrepancies is greatly appreciated.

How do you display panel(s)?

  • Present modally

How many panels do you displays?

  • 1

Environment

Library version
2.7.0 (but same behavior in 2.0.0)

Installation method

  • CocoaPods

iOS version(s)
17.0

Xcode version
15

@scenee
Copy link
Owner

scenee commented Sep 28, 2023

By default, this library haven't had "one stage at a time" restriction since v1. Therefore I think your FloatingPanelBehavior object implements the old method for the restriction.

func shouldProjectMomentum(_ fpc: FloatingPanelController, for proposedTargetPosition: FloatingPanelPosition) -> Bool

If so, you need to replace it with the new method of FloatingPanelBehavior.

@objc optional
func shouldProjectMomentum(_ fpc: FloatingPanelController, to proposedState: FloatingPanelState) -> Bool

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

2 participants