Learn about Core Location regions, and explore the code for entering a region.
- [Instructor] If you've asked your phone to remind you…of something when you're leaving your house or work,…you've used core location regions, also known as geofencing.…Geofencing is informing the user if they're entering…or exiting a geographic region.…Using core location, you can set up geofencing in your apps.…Let's write a new method to show us geofencing.…We'll see when we enter the on-ramp on the freeway drive…on Interstate 280 in the simulator.…I've already figured out the coordinates for you,…so you can get this set up as a constant in the class.…
Go to the properties for view controller…and under the heading, add…let onRampCoordinate…equal CLLocationCoordinate2DMake.…And that will be 37.3346 for the latitude,…and the longitude will be -122.0345.…
So we have that coordinate now.…We can use it later.…Head over to the location instant methods…and under disableLocationServices,…make a new function called monitorRegion.…I'm going to make it with a center parameter,…and that'll be a CLLocationCoordinate2D.…
- Getting coordinates from the web
- Working with Core Location data types and regions
- Creating a map in 2D, 3D, satellite, and flyover views
- Adding annotations
- Adding overlays
- Finding the current location
- Tracking heading, speed, and region
- Searching for locations
- Requesting and displaying directions
Skill Level Intermediate
iOS App Development: Test-Driven Developmentwith Harrison Ferrone2h 14m Intermediate
Advanced iOS Development: Working with APIswith Saul Mora1h 59m Intermediate
1. Basic Map and Location Concepts
5. Current Location
6. Heading, Speed, and Regions
Next steps1m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.