'Display of different pins custom on map SwiftUi (error extra argument)
I'm trying to display custom pins on my map, only an error appears "extra arguments at postions #7, #8 in call. If anyone can help me I would be grateful! (I'm new to swift)
var body: some View {
VStack {
if locationManager.location != nil {
Map(coordinateRegion: $region, interactionModes: .all, showsUserLocation: true, userTrackingMode: nil, annotationItems: pins,
annotationContent: { pin in
MapAnnotation(coordinate: pin.coordinate,
content: {
PinButtonView(pin: pin)
})
}, annotationItems: pins2,
annotationContent: { pin in
MapAnnotation(coordinate: pin.coordinate,
content: {
PinButtonView2(pin2: pin)
})
}).edgesIgnoringSafeArea(.all)
} else {
Text("On te localise BG... attend 2s")
}
}
.onAppear {
setCurrentLocation()
}
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
