Hello, I'am new to SwiftUI development and have a question about performance improvements for using the SwiftUI List. I basically have a NavigationSplitView, on the left side is a list with around 17.000 entries and on the right side is a detail view showing a chart. While scrolling through the list is ok, when I select an item to show the details I have a hang around 1-2 seconds. I don't know how to exactly improve performance so that the detail data appears instantly. Any help is welcome, here's the UI code:
Performance of SwiftUI List
Could you show the exact code of LogDetail(log:)
To check if it is the issue, test with the following change:
1og in
NavigationLink(destination: Text("same destination"))
I found this article that shows the problem is common with large listes: https://fatbobman.com/en/posts/optimize_the_response_efficiency_of_list/
Hope you will find solution in it.
Hello @Claude31 Thanks for the reply! I replaced the NavigationLink as you suggested, but I still have the 1-2 seconds hang. Also replacing the LogRow with a simple Text rending does not help. It always happens when I select something in the list. I'll check the link that you posted :-)