100 Days of SwiftUI Day 70

100 Days of SwiftUI – Day 70

Welcome to day 70 of the 100 Days of SwiftUI! We’ve arrived at the final 30 days and are slowly but surely reaching the end of the course. Yesterday, we focused on MapKit and biometric authentication. Today, we’re further expanding the MapKit implementation by adding more useful features to the Bucket List app. Let’s take a look!

Adding user locations to a map in SwiftUI

This project is going to be based around a map view, asking users to add places to the map that they want to visit. To do that we need to place a Map so that it takes up our whole view, track its center coordinate, and then also whether or not the user is viewing place details, what annotations they have, and more.

After following Paul’s guide and running the app, you should be able to move around the map freely and press the + button to add a new location.

Improving our map annotations

Right now we’re using MapMarker to place locations in our Map view, but SwiftUI lets us place any kind of view on top of our map so we can have complete customizability. So, we’re going to use that to show a custom SwiftUI view containing an icon and some text to show the location’s name, then take a look at the underlying data type to see what improvements can be made there.

Hacking with Swift, Paul Hudson (@twostraws)

SwiftUI makes this quite easy thankfully.

Wrap up

And that’s it for day 70! We’ll keep on going tomorrow as we look to add data from Wikipedia to our app, which should be very interesting to implement. For now, it’s high time to recharge.

Darryl

Hi! My name is Darryl and this is my personal blog where I write about my journey as I learn programming! You'll also find articles about other things that interest me including games, tech and anime.

Post navigation

Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

100 Days of SwiftUI – Day 4 – Type Annotations

100 Days of SwiftUI – Day 9 – Closures

100 Days of SwiftUI – Day 63

100 Days of SwiftUI – Day 76