I need to implement a grid view with dynamically-changing images.
Most of the time, I use a UITableView
to create a grid, but I run into memory issues if I have a large number of images.
In iOS 6, the UICollectionView
was added, but I've never used it before.
What are some "best practices" and view subclasses to use when making a grid view so I don't have memory issues?
How to use SwiftUI Grid. To use Grid , you populate a grid with GridRow structures. Each GridRow child views represent each cell/column in a grid view. In the following example we created a 2x2 grid (two rows and two columns).
A container view that arranges its child views in a grid that grows vertically, creating items only as needed.
Late to the party, but we have opensourced our commercial datagrid component and its free to use!
https://github.com/flexicious/iOSDataGrid
Its actually quite versatile in what it can do as compared to most libraries listed above.
http://www.ioscomponents.com/Home/IOSDataGrid
I would go with UICollectionView
as you said. You can actually see this answer I gave, where you can see already made libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With