Any ideas of how to replace this call? It was blindingly useful and has now been deprecated in iOS 17.0.
Map(coordinateRegion: $viewModel.region, showsUserLocation: true)
This was being fed via:
enum MapDetails {
static let startingLocation = CLLocationCoordinate2D(latitude: GlobalVariables.latitude, longitude: GlobalVariables.longitude)
static let defaultSpan = MKCoordinateSpan(latitudeDelta: GlobalVariables.span, longitudeDelta: GlobalVariables.span)
}
final class LocationViewModel: NSObject, ObservableObject, CLLocationManagerDelegate {
var locationManager: CLLocationManager?
@Published var region = MKCoordinateRegion(center: MapDetails.startingLocation, span: MapDetails.defaultSpan)
...
The yellow warning is:
'init(coordinateRegion:interactionModes:showsUserLocation:userTrackingMode:)' was deprecated in iOS 17.0: Use Map initializers that take a MapContentBuilder instead.
Is there an obvious replacement that I have overlooked?