CLCircularRegion

open class CLCircularRegion : CLRegion

A circular geographic region that you monitor using location services. Apple Documentation

Initialization

  • Creates a circular region with the specified center point and radius.

    Declaration

    Swift

    public override init(center: CLLocationCoordinate2D, radius: CLLocationDistance, identifier: String)

    Parameters

    center

    The center point of the circular region.

    radius

    The radius of the circular region in meters.

    identifier

    A unique identifier for the region. Apple Documentation

  • Creates a circular region from an NSCoder.

    Declaration

    Swift

    required public init?(coder: NSCoder)

    Parameters

    coder

    The NSCoder object used for decoding.

Testing Coordinate Containment

  • Returns a Boolean value indicating whether the specified coordinate is inside the region.

    Declaration

    Swift

    public override func contains(_ coordinate: CLLocationCoordinate2D) -> Bool

    Parameters

    coordinate

    The coordinate to test.

    Return Value

    true if the coordinate is inside the region; otherwise, false. Apple Documentation

NSCopying Conformance

  • Creates a copy of this CLCircularRegion instance.

    Declaration

    Swift

    public override func copy(with zone: NSZone? = nil) -> Any

    Parameters

    zone

    The zone in which to allocate the new object (default: nil).

    Return Value

    A new CLCircularRegion object with the same properties.