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.

Core Location regions

Core Location regions - iOS Tutorial

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

Start my 1-month free trial

Core Location regions

- [Narrator] As you set up our maps, you'll find maps require a region. Regions define an area of a map. Regions have two uses, for displaying maps, and detecting a user's proximity to a location. The first region you'll use, you'll find in MapKit. In MapKit, this is a rectangular visible area of a map. Since device screens are rectangular, they create a rectangle, and set scaling for the map. This region has a type of MKCoordinateRegion. There's two class methods to get the region. Both use a center coordinate. The first uses the differences in latitude and longitude to define the region. MKCoordinateSpan. The easier on for our purposes is the function MKCoordinateRegion make with distance, where you can set a distance in meters for latitude and longitude. The second kind of region you'll deal with is a CoreLocation Region. This is not rectangular, but circular. CoreLocation regions also have a center point as a CL location coordinate 2D, but only a radius from the point. This is to…

Contents