// // ListView.swift // TheSwiftWeek // // Created by Ingo Rohlf on 21.10.25. // import SwiftUI //import Playgrounds import Foundation struct ListView: TabContent{ static var title = "List" static var image = "list.bullet" @State var bikes = Bike.all var body: some View { List { Text(bikes[0].name) Text(bikes[1].name) Text(bikes[2].name) } List(bikes, id: \.name){ bike in HStack { Color(bike.color) //Circle().fill(style: bike.color) Text(String(bike.name)) Spacer() } } List(bikes, id: \.name){ Text(String($0.price)) } // Weil Vehicle jetzt Identifiable implementiert, geht es ohne id: \.name List(bikes){ Text(String($0.name)) } } } //#Playground { // var students = ["Bill", "Linus"] // let size = [1.65, 1.79] //} #Preview { ListView() }