Skip to content

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

@aornano

Description

@aornano

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions