Slide 12
Slide 12 text
ۭྻͷදࣔఆٛଆͰߦ͏
struct GridPokeListStyle: PokeListStyle {
var columns = [GridItem(.adaptive(minimum: 80), spacing: 16)]
func makeBody(configuration: PokeListConfiguration) -> some View {
ScrollView {
LazyVGrid(columns: columns, spacing: 16) {
ForEach(configuration.pokemons, id: \.self) { pokemon in
PokemonView(pokemon: pokemon)
}
}
.padding([.horizontal], 16)
}
.overlay {
if configuration.pokemons.isEmpty {
ContentUnavailableView("no pokemons",
systemImage: "circle")
}
}
}
}