Open DaisukeNagata opened 4 years ago
import SwiftUI
struct ContentView: View {
var columns: [GridItem] =
Array(repeating: .init(.flexible()), count: 2)
var body: some View {
ScrollView {
LazyVGrid(columns: columns) {
ForEach((0...3), id: \.self) {
let codepoint = $0 + 0x1f600
let emoji = String(Character(UnicodeScalar(codepoint)!))
Text("\(emoji)")
}
}.font(.largeTitle)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
https://developer.apple.com/documentation/swiftui/lazyvgrid