28 lines
795 B
Swift
28 lines
795 B
Swift
|
|
|
|
import SwiftUI
|
|
|
|
|
|
struct TrainView: View {
|
|
var train = Train(name: "RE3412", color: Color.yellow, delay: 2 ){ Bike.trek}
|
|
var train2 = Train(name: "RE1423", delay: 1){ Bike(name: "Bulls", price: 1.90, color: Color.red)}
|
|
|
|
|
|
var body: some View {
|
|
VStack{
|
|
|
|
|
|
Image(systemName: "train")
|
|
// train.color
|
|
HStack{
|
|
Text(train.localizedStringResource)
|
|
BikeView(bike: train.content)
|
|
}
|
|
// train2.color
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
TrainView()
|
|
}
|