Learn SwiftUI

Learn SwiftUI

Piecing it all together

Now that we've created our MapView, learned how to add pins (annotations), and learned how to customize our annotations too, we can integrate this straight into our recipe app.

In this section, we'll hook up our actual recipes to our MapView, placing an annotation on each country with a recipe. Then we'll use a custom annotation to list the country name and the number of recipes we have for that country.

We'll then take a look at the call out accessory view and how we can add a button that we'll be able to use to filter our ContentView list based on the country selected.

Finally, we'll add another navigation bar button item in order to clear our filter.

Updating our Helper classes

...
Unlock full access

Continue reading with a subscription

Packt gives you instant online access to a library of over 7,500 practical eBooks and videos, constantly updated with the latest in tech

End of Section 6

Your notes and bookmarks