Q-Mobile / QGrid

🎛 QGrid: The missing SwiftUI collection view.
MIT License
1.64k stars 104 forks source link

is it support cell reusability? #2

Closed satishVekariya closed 5 years ago

karolkulesza commented 5 years ago

QGrid uses SwiftUI only, which does not have a concept of cell/view reusability, as the structs conforming to SwiftUI's View protocol only desribe what needs to be presented on UI. All the implementation details are under the hood of SwiftUI.

I've inspected the memory graph hierarchy in my sample app and it seems that in the scenario when most of the grid cells are not visible on the screen, all the images views in the grid exist as separate UIView objects in the memory, so in this case there seems to be no reusability applied under the hood.

In case of SwiftUI's List, it seems that the cells are reused, as indicated here: https://stackoverflow.com/a/56656890/2506953