This package provides you a custom ScrollView and you can get the following featrues.
- Content offset
- Scroll direction
- End of scroll ((you can get the last content offset and scroll direction together)
- ScrollViewProxy
You can add this package on Xcode. See documentation.
You can just import BetterScrollViewSwiftUI to use the package.
@State private var contentOffset: CGPoint = .zero
@State private var scrollDirection: ScrollDirection = .unknown
BetterScrollView(contentOffset: $contentOffset, scrollDirection: $scrollDirection) { proxy in
// your code here
}
.onScrollEnded {
(offset, direction) in
// your code here
}
This package is licensed under BSD License