Apple Maps MKMapKit search location not functioning properly using MKLocalSearch.
I have to provide Location search functionality where user can enter input and app will suggest matched result and user can select one of them to display it on to map view and to get the address details from the location fetched from the selected result entry.
Currently MKLocalSearch request results sometimes provides error code "loadingThrottled" though we are cancelling previous request with a new search character entered.
Also MKLocalSearch provides only 10 results for searched string.
Is there any way I can improve this location search feature and provide a autocomplete in a better way?
According to apple docs:
There are no request limits per app or developer ID, so well-written apps that operate correctly should experience no problems. However, throttling may occur in a poorly written app that creates extremely large numbers of requests. https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/LocationAwarenessPG/EnablingSearch/EnablingSearch.html
You should use MKLocalSearchCompleter to retrieve auto-complete suggestions. It is provides most relevant results compared to MKLocalSearch.
Advantage:
Limitation:
Reference: Apple API Reference: MKLocalSearchCompleter