SwiftTabler icon indicating copy to clipboard operation
SwiftTabler copied to clipboard

Design of filtering for bound value tables not scalable

Open reedes opened this issue 3 years ago • 1 comments

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.

reedes avatar Mar 08 '22 17:03 reedes

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.

reedes avatar Mar 08 '22 17:03 reedes