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

Unlock the full course today

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

Code with location services

Code with location services - iOS Tutorial

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

Start my 1-month free trial

Code with location services

- [Instructor] With location services authorized, you're ready to get a device's location. Location's come from the CCLocation object, which we'll get from a delicate method. You, as a developer, have to tell location services to look for locations, then read the delegate, when the device has a location update. Head to the enable location services method we added earlier. Add an if statement here. We'll use the location services enable class method, to check if we have the right hardware, and if the user has location services turned on in the settings panel. If we do, I'll start updating locations with the start updating location method. So, if CLLocation Manager, location services enabled, location manager, start, updating location. I'll stop updating location at some point. Stop updating location in the disable location services, with the stop updating location method. So, that'll just be in here. Location manager, stop, updating location. When the user presses the here button on…

Contents