I want to be able to zoom my MKMapView to fit it\'s annotations. I have managed to do it using iOS7\'s showAnnotations method. But I would also like to add some
showAnnotations
another solution:
extension MKMapView { func fitAllMarkers(inset: UIEdgeInsets? = nil) { self.showAnnotations(self.annotations, animated: false) OperationQueue.main.addOperation { self.setVisibleMapRect(self.visibleMapRect, edgePadding: inset ?? UIEdgeInsets.zero, animated: true) } } }