Closed distivi closed 9 months ago
Currently you can access the percentage (0 - 1) of of how far along the pull gesture is via RefreshState.dragPosition
You can access this struct by providing a custom refreshView
- in the example it's implicitly passed to the default constructor. However you should be able to explicitly capture it with something like:
.refresher(refreshView: { $state in
return DefaultRefreshView(state: $state)
// Do something with state.dragPosition
.onChange(of: state.dragPosition) { newPosition in
print(newPosition)
}
}) { ...
Or you can implement your own custom refresh view similar to the example that captures and uses the RefreshState
struct.
Let me know if this works for your use case. If you need an explicit offset, I can add that as well - but you may be able to derive the offset you need from the dragPosition
Hi there, thanks for the lib!
As this view makes some work already to get scrollView offset, i'm wondering if you can expose offset value using @Binding or closure? That would be super helpful for making parallax-like effects for headers etc.