Domanda

I'm developing an iOS app and I want to be able to have a textfield for users to enter in an address and when you enter in a character for the street name, a pop up below the textfield will appear suggesting the street name.

Does anyone know whether something like this already exists? Alternatively, if someone has any suggestions? Basically, I want to have a field for a user to enter in their start location and then another field for the user to enter in their destination location, but instead of relying solely on the user knowing how to spell the street name; was hoping for something like I mentioned above.

Thanks in advance.

È stato utile?

Soluzione

I answered a very similar question recently.

You can use a UISearchDisplayController and implement the autocomplete features by invoking the forward geocoding at every letter typed by the user.

You can look at my answer here

Altri suggerimenti

Hope, by using Location Manager to find all location near you and store it into an array.Then after show these details in a table view and after that using a searchbar you can provide the same functionality.

You can use the Google Places autocomplete API to achieve this - documentation is here. Note there are some T&Cs associate with it, one of which (I think) is you need to use a Google Map, rather than Apple's native maps (not a problem pre iOS 6, and there is a Google Maps SDK available, although currently I think you need to request access).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top