SwiftUI Maps & Location: Fundamentals

Mar 15 2022 Swift 5.5, iOS 15, Xcode 13

Part 2: Core Location

20. Conclusion

Lesson Complete

Save for later
About this episode
See versions

See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 19. Enable Region Monitoring

The student materials have been reviewed and are updated as of January, 2022.

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

Camera

At this point, you should have a good idea of how Core Location can benefit you behind the scenes.

Location Manager & CLLocations

When we started this part, you learned about the Location Manager and CLLocations. Remember to follow Apple’s guidelines in accessing Core Location services when you need them. So if you have an app that has a login screen, you don’t want to start tracking location. Rather, have the user login into your app, and then start them when the user does an an action that is location specific.

Permissions & Background Updates

Next you learned about permissions to access Core Location. Remember, while a user gives your app permission today, your app may not have permission tomorrow. When requesting permissions, make sure to provide a clear explanation about why you need permission. If your reason is vague, your app may be stalled in app review. You also saw how Core Location can work in the background. This is a powerful feature, but again, only use it when you need it as it does raises privacy issues.

Geoencoding

Then you learned about Geoencoding where you can take an address and convert it into a CLLocation, and of course, do the reverse. This does rely on the network so remember when working geoencoding, your user may not be in ideal network conditions.

Region Monitoring

Finally, you learned about region monitoring and how to get notifications when a user enters or exits a region. When we first made this series a few years ago, Apple set a hard limit of 20 regions for our app. Since that time, nothing has changed. We can still only track 20 regions, so you’ll need to track only the most important areas.

Where to go from here

As you can see, both MapKit and Core Location provide a great many features to your app. But we’ve only scratched the surface of what is possible. To learn more about MapKit features such as requesting directions, drawing on maps and even creating custom map tiles, check out our Advanced Mapkit Course.