SwiftUI Maps & Location: Fundamentals

Mar 15 2022 · Swift 5.5, iOS 15, Xcode 13

Part 2: Core Location

20. Conclusion

Episode complete

About this episode

Leave a rating/review

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

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Notes: 20. Conclusion

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

Transcript: 20. Conclusion

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.

While we covered a lot with Core Location, there are still a lot of awesome features to use. For instance, Core Location automatically determines important locations based on the time and frequency that a user visits a location. These are represented by CLVisits. Like region monitoring, we can get notified when a user visits these special locations. We can also get information about when they arrived and when they left. With beacons, you can take Core Location indoors to provide location information, send notifications, and even track which floor a user is located. For more information about Beacons, check out our tutorial, “iBeacons with iOS and Swift”.

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.

Also, check out raywenderlich.com and search for maps. You’ll find that we have a lot of content on MapKit that covers all various aspects of it.

Finally, check out the WWDC videos released by Apple. Consider the 2019 version What’s New in Core Location a must watch. The 2020 What’s New in Location is equally important. There are also other videos such as Design for Location Privacy to help you develop apps while keeping a user’s privacy. A great place to watch these videos is on macOS. Download the developer app and look under the Maps & Locations section.

Thanks again for watching this course. I hope you enjoyed it. See you next time.