A legacy UIScrollView wrapper for SwiftUI.
Add a dependency in your your Package.swift
.package(name: "LegacyScrollView", url: "https://github.com/bwide/LegacyScrollView", from: "1.0.0")
LegacyScrollView(.vertical, showsIndicators: true) {
content
}
.onGestureShouldBegin { pan, scrollView in
pan.translation(in: scrollView).y > 0
}
.onScroll { scrollView in
print(scrollView.contentOffset.y)
}
with this package you'll have access to these UIScrollView delegate callbacks
.onScroll { scrollView in }
.onReachBottom { scrollView in }
.onReachTop { scrollView in }
.onEndDecelerating { scrollView in }
.onEndDragging { scrollView in }
and this UIScrollViewOverride
.onGestureShouldBegin { panGesture, scrollView -> Bool in }