I searched but I can not find anywhere how to setup infinite scroll with SwiftUI
Does SwiftUI support this feature?
I cannot comment on the new SwiftUI libraries, I havent used them yet, but I have implemented this functionality using the old Cocoa classes. My solution used NSScrollView which only supports finite scrolling but I extended it in a way that results in a user perceived infinite scroll.
The solution arrived at was to always set the sketch view bounds to have a 600 pts margin around visible portion. When the sketch view is scrolled the backing buﬀer of pixels is translated relative to its viewport, but if the displacement vector ever exceeds 500 pts in either the x or y direction then it triggers the sketch view to be re-centered around the visible portion but with the sketch views content shifted by the displacement vector to perfectly counteract the re-centering. The margin and recenter threshold values were arrived at through experimentation and gives smooth performance tailored to the inertia and velocity of a fast two ﬁnger swipe gesture.