2016-07-06 4 views

Antwort

0

Wenn Sie es wollen, dann können Sie eine Erweiterung für den MKMapView wie unten haben.

extension MKMapView { 
    func getBounds() -> (southWestPoint: CLLocationCoordinate2D, northEastPoint: CLLocationCoordinate2D) { 
     let visibleMapRect = self.visibleMapRect 
     let neMapPoint = MKMapPointMake(MKMapRectGetMaxX(visibleMapRect), visibleMapRect.origin.y) 
     let swMapPoint = MKMapPointMake(visibleMapRect.origin.x, MKMapRectGetMaxY(visibleMapRect)) 
     return (southWestPoint: MKCoordinateForMapPoint(swMapPoint), northEastPoint:MKCoordinateForMapPoint(neMapPoint)) 
    } 
} 

Jedes Mal, wenn Sie die gebundene wollen rufen Sie einfach die getBounds Methode.