Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 3: crash to "as! CLGeocodeCompletionHandler" #26

Open
aornano opened this issue Oct 6, 2016 · 0 comments
Open

Swift 3: crash to "as! CLGeocodeCompletionHandler" #26

aornano opened this issue Oct 6, 2016 · 0 comments

Comments

@aornano
Copy link

aornano commented Oct 6, 2016

the fileprivate func geoCodeAddress(_ address:NSString){} caused an error due to a

warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.

To correct it , it's enough to correct this line:

geocoder.geocodeAddressString(address as String, completionHandler: ({(placemarks: [CLPlacemark]?, error: NSError?) -> Void in

to:

geocoder.geocodeAddressString(address as String, completionHandler: ({(placemarks: [CLPlacemark]?, error: Error?) -> Void in

You can find more details also here in SO

You also don't need to force casting to as! CLGeocodeCompletionHandler, so it can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant