Post

Replies

Boosts

Views

Activity

Reply to SwiftUI MapKit - MapAnnotation - Publishing changes from within view updates is not allowed, this will cause undefined behavior.
Having this problem as well (Xcode 14.3 iOS 16.4). The problem only happens with MapAnnotation. Using MapMarker causes the purple warnings to go away. Another option to suppress the warnings is to use a constant value for the map's coordinateRegion binding. Not possible if you actually need the value but thought I'd post it here anyways. E.g., Use Map( coordinateRegion: .constant(mapRegion), // <-- use .constant(mapRegion) instead of $mapRegion annotationItems: items, ...
Jun ’23