New SwiftUI Support for MapKit in Xcode 15 | Kodeco

At WWDC 2023, Apple announced big improvements to SwiftUI support for MapKit. Learn all about your new options for maps, markers, annotations, style and camera position.


This is a companion discussion topic for the original entry at https://www.kodeco.com/40607811-new-swiftui-support-for-mapkit-in-xcode-15

Thanks for the post. Is there a way to specify user tracking mode in the newer Map() syntax? For example if we wish to specify userTrackingMode = .followWithHeading

hi Abhijit! MapUserTrackingMode has been deprecated, but there’s a MapUserLocationButton that sets the framing of the associated map to the user location. Also, MapCameraPosition has Boolean properties followsUserHeading and followsUserLocation.

See if this article helps.

Thank you Audrey. I was able to get what I wanted by adding map controls and then using the MapUserLocationButton() button to orient the map such that up was where I am heading.

1 Like