Class

CLRegion

An area that can be monitored.

Overview

In iOS, this class is abstract and you do not create instances of this class directly; instead, you instantiate subclasses that define specific types of regions. In macOS, you create instances of this class and use them to store the region information. After you create a region, you must register it with a CLLocationManager object. The location manager generates appropriate events whenever the user crosses the boundaries of the region.

To use this class, create an instance of it and use the startMonitoring(for:) method of a CLLocationManager object to begin monitoring it.

Topics

Initializing a Region in macOS

init(circularRegionWithCenter: CLLocationCoordinate2D, radius: CLLocationDistance, identifier: String)

Initializes and returns a region object defining a circular area.

Deprecated

Accessing a Region’s Attributes

var identifier: String

The identifier for the region object.

Configuring Notification Delivery

var notifyOnEntry: Bool

A Boolean indicating that notifications are generated upon entry into the region.

var notifyOnExit: Bool

A Boolean indicating that notifications are generated upon exit from the region.

Hit Testing in a Region

func contains(CLLocationCoordinate2D)

Returns a Boolean value indicating whether the region contains the specified coordinate.

Deprecated

Constants

enum CLRegionState

Constants that reflect the relationship of the current location to the region boundaries.

Deprecated

var center: CLLocationCoordinate2D

The center point of the region.

Deprecated
var radius: CLLocationDistance

The radius (measured in meters) that defines the region’s outer boundary.

Deprecated

Relationships

Inherits From

See Also

Region Monitoring

Monitoring the User's Proximity to Geographic Regions

Use region monitoring to determine when the user enters or leaves a geographic region.

class CLCircularRegion

A circular geographic region, specified as a center point and radius.