I use lazyVStack lazyGrid and ScrollView to build a Symbol Picker. But you know, there are more than 1300 symbols in Symbol Library. So I use LazyVStack and LazyVGrid.
Here is my code:
My problem is: When I scroll very fast. CPU usage will goes to 100% and the performance is reeeally bad. Scrolling Animation is caton. Do you have any suggestions?
Here is my code:
Code Block swift ScrollView { LazyVStack { VStack(alignment: .leading) { CategoryNameIndicator() LazyVGrid(columns: columns) { ForEach(symbolGroup.symbolsName, id: \.self) { symbol in SymbolPickerCell(symbol: symbol, canBeSelected: true, selectedSymbol: $symbolLibrary.selectedSymbol) .padding(15) .padding(.bottom, 5) } } .compositingGroup() // -> I don't know if this will improve the performance. But I used. } } }
My problem is: When I scroll very fast. CPU usage will goes to 100% and the performance is reeeally bad. Scrolling Animation is caton. Do you have any suggestions?