I am using MKMapView on a project and would like to center the map on a coordinate and zoom in. Just like Google maps has:
GMSCameraPosition.camera(withLatitude:
Put the below code in your CustomMapView
subclass of MKMapView
Call is from init
class CustomMapView: MKMapView {
private func zoom() {
let dortmundLocation = CLLocation(latitude: 51.516667, longitude: 7.466667)
let dortmunRegion = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: dortmundLocation.coordinate.latitude, longitude: dortmundLocation.coordinate.longitude), span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01))
self.setRegion(dortmunRegion, animated: true)
}
}