From the course: Advanced iOS App Development: MapKit & Core Location

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution 6: Exiting a region

Solution 6: Exiting a region - iOS Tutorial

From the course: Advanced iOS App Development: MapKit & Core Location

Start my 1-month free trial

Solution 6: Exiting a region

- [Instructor] Okay, we're back from the challenge. I said there was an easy way to do this. Go ahead and stop the app, and LocationManager didEnterRegion is almost identical to LocationManager didExitRegion, so what you do, copy, paste, change enter to exit, ramp to freeway, and that's all you need to do. We already set the system so that it would know to inform you of an exit region so go ahead and run this. There we are at Apple, location, freeway drive, there we go spinning our wheels, we get on the on ramp. Now you'll notice it takes a while once it's on the freeway, and there it is. We're on the freeway. The system makes sure that you are not just wavering along the edge of the region, it's actually making sure you are in it for a certain number of seconds before it says anything. Okay, go ahead and put debug location Apple. We go back to our original location. Go ahead and stop the app. There are other types of regions, by the way. You could set your own geometry, for example…

Contents