fluidgroup/fluidinterfacekit
- FluidCore
FluidGesture
[CleanShot 2024-03-29 at 04 11 57]
Making a view can be draggable in an easier way. Supports dragging finished animation with moving another position respecting gesture's velocity using spring animation. Rubber banding effect is built-in.
let draggableView: UIView
draggableView.makeDraggable(
descriptor: .init(
horizontal: .init(min: -200, max: 200, bandLength: 30),
vertical: .init(min: -200, max: 200, bandLength: 30),
handler: .init(
onStartDragging: {
},
onEndDragging: { velocity, offset, contentSize in
// return proposed offset to finish dragging
return .init(width: 0, height: 0)
}
)
)
)Support this projects
<a href="https://www.buymeacoffee.com/muukii"> <img width="120" alt="yellow-button" src="https://user-images.githubusercontent.com/1888355/146226808-eb2e9ee0-c6bd-44a2-a330-3bbc8a6244cf.png"> </a>
Muukii sponsors your contributions
I sponsor you with one-time sponsor tiers if you could have contributions.
- Improvement core components
- Improvement documentations
- Growing demo applications
Authors
Package Metadata
Repository: fluidgroup/fluidinterfacekit
Default branch: main
README: README.md