April 2020
Beginner
316 pages
8h 20m
English
Now let's head on back over to RecipeMapView.swift to make just a couple of small changes to our SwiftUI View in order to work with our MapLocationManager.
Let's start by adding a reference to our MapLocationManager. Looking back at the previous section, can you think of anything special/different that we'll need to do in order for this object to listen for changes...?
@ObservedObject var locationManager = MapLocationManager()
That's right, we'll need to prefix it with @ObservedObject in order for our Combine logic to kick in and make us aware of any changes to our location.
Once we've got that back in place, let's grab the latitude and longitude from MapLocationManager and pass them to our previously ...
Read now
Unlock full access