I have a List
in SwiftUI that I need to refresh but maintain current scroll position after refresh. I could do this in UITableView
in UIKit but it seems impossible in SwiftUI. Am I missing something?
I have a List
in SwiftUI that I need to refresh but maintain current scroll position after refresh. I could do this in UITableView
in UIKit but it seems impossible in SwiftUI. Am I missing something?
2
Answers
It works if you have iOS 17 otherwise you should use
ScrollView
.Since you haven’t added code here, Please make sure you are following this thing in your code:
List will be refreshed once you refresh data. That is a main feature of SwiftUI. You don’t need to refresh like UITableView in UIKit. I suggest you to study more about SwiftUI.