Lazy loading
Does this library support lazy loading like in LazyVGrid/LazyHGrid?
Hi @kushsolitary. Thanks for your question!
In WWDC22 I had the opportunity to ask SwiftUI engineers about this online, and their answer was that SwiftUI's Layout protocol does not currently support lazy loading views. I filed a feedback to them (FB11708501) with the title 'Lazy container with the Layout protocol'. They haven't implemented it by WWDC23, so we hope for the best next year.
Hi, revisiting this topic. It would be great to have proper Lazy Loading support, even if Layout doesn’t natively support it. A simple solution could be to calculate the screen size and element arrangement, using dummy placeholders instead of actual items. Alternatively, the ideal approach would be to use LazyVStack or LazyHStack internally within the Flow view representable.
Great suggestion! It's definitely something I'd like to include in the library eventually. Some of my early prototypes with LazyStacks and LazyGrids seemed promising, just need to find the right API. If I'm willing to give up some of the feature-set (like advanced line spacing algorithms), the basic flow layout seems easy to implement with a built-in lazy container.