CollectionThing
CollectionThing copied to clipboard
Adding a bunch of features and refactoring the code to make it more reusable
- Refactors logic into FastCollection which now takes an arbitrary model and view
- Added public/private to things in a reasonable way
- Adding the ability to have variable row heights
- Making row height a parameter you can set
- Removing a VStack which was at the base of ContentView that didn't do anything
- Added a buffer parameter which allows you to load more views above and below the content window and means you're less likely to see white space when scrolling quickly
New commit: This makes visibleRows a calculated property This is necessary because otherwise it's only updated when you scroll But you actually want to recalculate this every time body is called because the data in the view may have changed (due to insertion, deletion or completely new data) Performance wise, I wasn't able to find any significant difference. Before and after this change, visible rows is calculated approximately the same number of times. Also, I deleted the translatingY function as it wasn't used
Fixes https://github.com/liscio/CollectionThing/issues/3
Another commit: FIxes a bug where visibleBounds wasn't updated correctly Makes a couple of performance improvements