scenee / FloatingPanel

A clean and easy-to-use floating panel UI component for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues after migrating to 2.0

egk2374 opened this issue · comments

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

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