Do any 1 know any changes on swift3?How to fix the following code I m using geococdeAddressString
class func getMapByAddress(_ locationMap:MKMapView?, address:String?, title: String?, subtitle: String?)
{
let geocoder = CLGeocoder()
geocoder.geocodeAddressString(address!, completionHandler: {(placemarks: [CLPlacemark]?, error: NSError?) -> Void in
if let validPlacemark = placemarks?[0]{
print(validPlacemark.location?.coordinate)
let span = MKCoordinateSpanMake(0.05, 0.05)
let region = MKCoordinateRegion(center: (validPlacemark.location?.coordinate)!, span: span)
locationMap?.setRegion(region, animated: true)
let annotation = MKPointAnnotation()
annotation.coordinate = (validPlacemark.location?.coordinate)!
annotation.title = title
annotation.subtitle = subtitle
locationMap?.addAnnotation(annotation)
}
} as! CLGeocodeCompletionHandler)
}
Error at this line..is just crash at this line as! CLGeocodeCompletionHandler)
with no error just showing <private>