FloatingPanel
FloatingPanel copied to clipboard
How to automatically close FPS after dragging a certain distance instead of dragging it to the bottom
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
}
That's right, @VisualDeceit!