I assume you want to avoid bounces, here is possible approach (tested with Xcode 12 / iOS 14)
struct ContentView: View {
var body: some View {
GeometryReader { geo in
ScrollView {
Rectangle()
.frame(width: geo.size.width, height: 1800)
.foregroundColor(.black)
.background(ScrollViewConfigurator {
$0?.bounces = false // << here !!
})
Spacer()
}
}
}
}
struct ScrollViewConfigurator: UIViewRepresentable {
let configure: (UIScrollView?) -> ()
func makeUIView(context: Context) -> UIView {
let view = UIView()
DispatchQueue.main.async {
configure(view.enclosingScrollView())
}
return view
}
func updateUIView(_ uiView: UIView, context: Context) {}
}
Note: enclosingScrollView()
helper is taken from my answer in How to scroll List programmatically in SwiftUI?