It is a practical application using LazyVGrid announced at WWDC2020. As soon as you download it, you'll see how great it is.
It's a beta version, so you need to be aware that it may not work properly with the official release.
Run this script to install it.
$ ./setup.sh
This application uses Flickr to search for images to display. First, get the Flickr API key from here.
Next, set the acquired character string in KeyHelper.consumerKey
and KeyHelper.consumerSecret
respectively.
import Foundation
enum KeyHelper {
static var consumerKey: String {
"XXXXXXXXXX"
}
static var consumerSecret: String {
"XXXXXXXXXX"
}
}
The left is an example using LazyVGrid
. And the right is an example of not using LazyVGrid
at all. You can see that it is now very simple to implement.
Evolution doesn't stop there.
As its name suggests, LazyVGrid can handle delayed rendering. The drawing of each View is only started when it is displayed on the screen.
env | version |
---|---|
Swift | 5.x |
Xcode | 12.x |
iOS | 14.x |
AkkeyLab/LazyGrid is available under the MIT license. See the LICENSE file for more info.