I don't know how to make swiftUI know when I scroll to the end of a List. The key problem is, I can't use .onAppear() function in the element in List().
I tried to develop a ios app demo, using List() struct in the main view.I want to make the app know when I scroll to the end of the list and do something (like adding more content to the list). I tried to realized it by adding an element to the end of the List, and use .onAppear() function to modify that element. But I failed because of thread error- signal SIGABRT.
List {
//some view
Text(" ")
.onAppear() {
//do something
}
.onDisappear() {
//do something
}
}