From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 23,200 courses taught by industry experts.

SwftUI maps and map zoom

SwftUI maps and map zoom

- [Instructor] Since I published SwiftUI Essential Training and Advanced iOS Development, MapKit and Core Location in the LinkedIn Learning library, a different way of making maps has shown up, using MKMapPoints and MKMapRect, instead of MKMapRegion and CLLocationCoordinate2D. I'm going to add a map like the one I have here on the simulator to a SwiftUI project to demonstrate, which I have over here in the preview. So I'm going to close up the simulator right now. And talk a little bit more about this. So MapPoints are a coordinate system that flattens the world to a 2D coordinate system so longitudes are all parallel instead of what they are with a circle. The MapPoints are meaningless to humans but you can cast a CLLocationCoordinate onto an MKMapPoint and then you can use the coordinate and points as an origin for MKMapRect and it works the same way as you would find with a CGRect with an origin and a size. So if you…

Contents