FloatingPanel icon indicating copy to clipboard operation
FloatingPanel copied to clipboard

Swipe left, right, up, down to dismiss

Open mschonvogel opened this issue 5 years ago • 3 comments

I was wondering if you could provide an example of how to remove the panel by swipe left, right, up, and down. That'd be very helpful!

mschonvogel avatar Nov 09 '20 13:11 mschonvogel

Have you tried FloatingPanelController.isRemovalInteractionEnabled?

scenee avatar Nov 10 '20 10:11 scenee

Yes @SCENEE, but this only enables a dismiss by the swipe-down gesture. How can I dismiss the panel by swiping left/right?

mschonvogel avatar Nov 10 '20 17:11 mschonvogel

Alright, @michalraska. You can layout a panel positioned at top, left and right by specifying FloatingPanelLayout.position and then are able to remove the panel by swipe up, left, or right 👍

If you use a bottom positioned panel, you need to implement a swipe gesture to dismiss the panel by swiping left/right on the surface view or the root view(FloatingPanelContorller.view) while keeping in mind gestures in a content view controller for the panel. FloatingPanelPanGestureRecognizer.delegateProxy might help you 😌

scenee avatar Dec 12 '20 02:12 scenee