I have List
with 100 items
I want to scroll to item number 20
How can I achieve this in SwiftUI
Here is my simple ListCode
struct ContentView: View {
var body: some View {
List {
Button(action: {
self.scrollToIndex(index: 20)
}) {
Text("Scroll To 20")
}
ForEach(0..<100) {_ in
Text("Hello World")
}
}
}
func scrollToIndex(index: Int) {
}
}