I have to pass these data to my MapView and I keep getting the following error: Type '()' cannot conform to 'View'
I need different data for the 3 cases so I thought I will set it up just before passing ig through the NavigationLink, but apparently I can't do so. How can I manage this?
var body: some View {
NavigationView{
VStack{
HStack{
annotations = Locs(name: "Sultan Hotel", coord: CLLocationCoordinate2D(latitude: 5.55739, longitude: 95.3208), alarm: 0, state: 0, radius: 1)
NavigationLink(destination: MapView()){
Text("Sultan Hotel").foregroundColor(.black)
.font(.system(size:25))
.fontWeight(.bold)
.padding()
}
Spacer()
if (annotations.state == 1 ) { Text("ON ")}
else if (annotations.state == 0 ) { Text ("OFF") }
}
HStack{
NavigationLink(destination: MapView()){
Text("Paparon Pizza Lhokseumawe").foregroundColor(.black)
.font(.system(size:25))
.fontWeight(.bold)
.padding()
}
Spacer()
if (state == 1 ) { Text("ON ")}
else if (state == 0 ) { Text ("OFF") }
}
HStack{
NavigationLink(destination: MapView()){
Text("Pocut Baren").foregroundColor(.black)
.font(.system(size:25))
.fontWeight(.bold)
.padding()
}
Spacer()
if (state == 1 ) { Text("ON ")}
else if (state == 0 ) { Text ("OFF") }
}
Spacer()
}.navigationTitle("Geofence")
}
}