CLGeocoder's geocodeAddressString function always return an array with only one CLPlacemark object, independently of the string passed as a parameter. I'm using it like this: let placesArray = try await CLGeocoder().geocodeAddressString(addressString) CLGeocoder's documentation is clear: In the case of forward-geocoding requests, multiple placemark objects may be returned if the provided information yielded multiple possible locations. But that never happens. Even when passing something like San which should obvioulsy return an array with many CLPlacemark possibilities. I've seen this same question asked in multiple places (like here, here, here, and here) but I can't find an answer. Is this a bug? Am I doing something wrong? How can I obtain multiple possible locations from CLGeocoder? EDIT: MKLocalSearch I tried the same thing using MKLocalSearch: let searchRequest = MKLocalSearch.Request() searchRequest.naturalLanguageQuery = addressString let search = MKLocalSearch(request: searchRequest
Search results for
geocodeAddressString
17 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am trying to derive the Apple Place ID from a CLPlacemark (or via a MKMapItem derived from it) created via either CLGeocoder().reverseGeocodeLocation() or CLGeocoder().geocodeAddressString(). In many cases, the placemark returned from these functions contains detailed information (name, address, coordinates, etc), implying that the Apple Place ID is known, but the identifier is not present. The only way I have found to get a Place ID is via MKLocalSearch. Wondering if I am missing something here.