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)
Post
Replies
Boosts
Views
Activity
Very simple one. how do I add “create“ permissions for my CloudKit security roles. For some reason “create“ is greyed out when I try to check the box for _creator