Learn Courses My Dashboard

iOS Foundations (SwiftUI) Module 6

Hello all,.
i’ve finished the iOS Foundations (SwiftUI) course, witch went pretty well.
on module 6, the search of the places, is done by location.
just wondering, if anyone can help with…
when switch to map view, if we move the map to other zone, how can we get that location?, if the location is changed set a button to do a new search based on the new location.
i think that would be a great improvement to the app.

Thanks

Hi Jorge,

The way the MapView presents the places of interest on the Map with the annotation pins is dependent on your physical location. In other words if you drive down the road 10ks away from where you are now and then run the App, the selected places of interest will change and be based on the new radius of where you are located. The MapView will place those pins and then arrange the view so that you are in the centre (the blue dot) and the pins will be spread out around you depending on how far away they are. Obviously you need to load the App on a real device to see that working.

Thanks for your reply

What I meant was.
Searching for places different from the user location.
Like I’m in Sydney, and would like to search for places in Melbourne.

Ah right, What you would have to do is come up with a way to ask the user to enter the latitude and longitude for a location that they were interested in or default to the current location or allow them to select a location on a map.