Posts

Post not yet marked as solved
2 Replies
364 Views
Hi , I'm trying to teach myself the new Mapkit code. Can someone help me fix the code below: I'm getting the following error on Line 19: Initializer 'init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:annotationItems:annotationContent:)' requires that 'Marker' conform to 'MapAnnotationProtocol' import MapKit struct IdentifiableAnnotation: Identifiable { let id = UUID() var annotation: MKPointAnnotation } struct ContentView: View { @ObservedObject var locationManager: LocationManager @State private var showUserProfile = false @State private var showNotifications = false @State private var showFriendz = false @State private var courtAnnotations: [IdentifiableAnnotation] = [] var body: some View { NavigationView { ZStack(alignment: .bottom) { Map(coordinateRegion: $locationManager.region, interactionModes: .all, showsUserLocation: true, userTrackingMode: .none, annotationItems: courtAnnotations) { item in Marker(<#LocalizedStringKey#>, coordinate: item.annotation.coordinate) } .edgesIgnoringSafeArea(.all)
Posted
by hupr2828.
Last updated
.