Question

I'm still a noobie to app making, and i've been trying to read some of the documentary for the MapKit, but im still clueless on how to do this.

I have a textfield on TabBar2, and Apple Map on TabBar1. How do i make the textfield on TabBar2, searchable for destinations like adresses ? and then show the found destination, on the map on TabBar1 ?

I hope this made some sense.

Thanks in advance

Was it helpful?

Solution

One way to do it is to use MKLocalSearchClass which searches for key words and can be tricked to look for addresses as well. You need to incorporate MKLocalSearchHandler in your class in order to produce the results. You can then add the results in a map view. Apple has a sample code which works basically the same way. It creates a search based on keywords and shows the location of those keywords nearby the users location. For example coffee or movie or etc. the code can be changed to look for a address or anything else you want. Any how here is the link to the sample code, hope it guides you to the right direction.

Map Search Sample Code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top