Skip to content

MapKit MapViewHolder

MapKitViewState.getMapViewHolder() returns AnyMapViewHolder?. The native MapKit object can be cast to MKMapView.

import MapKit
if let holder = mapViewState.getMapViewHolder(),
let mapView = holder.mapView as? MKMapView {
mapView.showsTraffic = true
}

Map type changes that are covered by the SDK should use mapDesignType instead:

mapViewState.mapDesignType = MapKitMapDesign.Hybrid