Adam Adam - 1 year ago 108
Swift Question

Swift span zoom

Need simple coding for the span to zoom on the users location when the button is pressed. It follows the user but need span coding help.

i use this atm

@IBAction func Refreshbutton(sender: AnyObject) {

Mapview.userTrackingMode = .Follow


Answer Source

This code may help you.

let span = MKCoordinateSpanMake(0.075, 0.075)
let region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude:lat, longitude: long), span: span)
mapView.setRegion(region, animated: true)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download