Hello, it's my first app on swift
May you help with this errors please:
import SwiftUI
struct Option: Hashable{
let Title: String
let imageName: String
}
struct ContentView: View {
let options : [Option] = [
.init(Title: "Home", imageName: "house"),
.init(Title: "About", imageName: "info.circle"),
.init(Title: "Settings", imageName: "gear"),
.init(Title: "Social", imageName: "message"),
]
var body: some View {
NavigationView{
ListView(options: options)
MainView()
}
.frame(minWidth: 600, minHeight: 400)
}
}
struct ListView: View {
let options: [Option]
var body: some View {
VStack{
ForEach(options, id: \.self) {option in
HStack {
Image(systemName: option.imageName)
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20)
Text(option.title)
Spacer()
}//HStack end..
.padding()
}//forEach end..
Spacer()
}//VStack end..
}//var body end
}
struct MainView: View {
var body: some View{
Text("List")
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}