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

How to automatically close FPS after dragging a certain distance instead of dragging it to the bottom #540

Open
BeingCode opened this issue Apr 24, 2022 · 2 comments

Comments

@BeingCode
Copy link

No description provided.

@VisualDeceit
Copy link

VisualDeceit commented Jul 28, 2022

You should implement method floatingPanel(_:shouldRemoveAt:with:) of delegate FloatingPanelControllerDelegate
Like this:

func floatingPanel(_ fpc: FloatingPanelController, shouldRemoveAt location: CGPoint, with velocity: CGVector) -> Bool {
        let height = fpc.contentViewController?.view.bounds.height ?? 0
        if location.y > height / 2 || velocity.dy > 5.5 {
            return true
        }
        return false
    }

@scenee
Copy link
Owner

scenee commented Jul 30, 2022

That's right, @VisualDeceit!

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

3 participants