Sunday, May 1, 2016

how to zoom-in on the Mapkit by swift

 @IBAction func zoomInMap (sender: AnyObject) {
        let userLocation = mapView.userLocation
        let region = MKCoordinateRegionMakeWithDistance(userLocation.location!.coordinate, 800, 800)
        mapView.setRegion(region,animated:true)

    }


connect with action "zoomInMap"
set the parameter in MKCoordinateRegionMakeWithDistance property. 

No comments:

Post a Comment