SwiftTabler
SwiftTabler copied to clipboard
Design of filtering for bound value tables not scalable
Applies to tables with bound values, where an if {} is used in the ViewBuilder to include only rows that pass the filter.
This works fine for small row count, but wouldn't work well for larger row counts.
(Doesn't apply to Core Data, where it's assumed that the developer will apply a predicate to the FetchRequest to filter rows.)
The README table of views notes this issue as a caveat.
One possible approach is to not use a simple binding for the array of values, but rather place the them inside an observable model object, as described here:
https://peterfriese.dev/posts/swiftui-listview-part2/
Note in particular the dynamic filtering done on the list search.