CLRegion
open class CLRegion : NSObject, NSCopying, NSSecureCoding
A geographic region that you monitor using location services. Apple Documentation
-
The unique identifier for the region.
Declaration
Swift
public let identifier: String -
The center point of the region (latitude and longitude).
Declaration
Swift
public let center: CLLocationCoordinate2D -
The radius of the region in meters.
Declaration
Swift
public let radius: CLLocationDistance -
Indicates whether the region triggers entry events.
Declaration
Swift
public var notifyOnEntry: Bool -
Indicates whether the region triggers exit events.
Declaration
Swift
public var notifyOnExit: Bool
-
Required for
NSSecureCodingDeclaration
Swift
public static let supportsSecureCoding: Bool -
Initializes a region with the specified center and radius.
Declaration
Swift
public init(center: CLLocationCoordinate2D, radius: CLLocationDistance, identifier: String)Parameters
centerThe geographical center of the region.
radiusThe radius of the region in meters.
identifierA unique string identifier for the region.
-
Decodes an instance of
CLRegionfrom anNSCoder.Declaration
Swift
required public init?(coder: NSCoder)Parameters
coderThe
NSCoderobject used for decoding. -
Encodes an instance of
CLRegioninto anNSCoder.Declaration
Swift
public func encode(with coder: NSCoder)Parameters
coderThe
NSCoderobject used for encoding. -
Checks whether a specific coordinate is inside the region.
Declaration
Swift
public func contains(_ coordinate: CLLocationCoordinate2D) -> BoolParameters
coordinateThe coordinate to check.
Return Value
A Boolean indicating if the coordinate is within the region’s boundaries.
-
Creates a copy of this
CLRegioninstance.Declaration
Swift
public func copy(with zone: NSZone? = nil) -> AnyParameters
zoneThe zone in which to allocate the new object (default:
nil).Return Value
A new
CLRegionobject with the same properties.
-
Undocumented
Declaration
Swift
public static func == (lhs: CLRegion, rhs: CLRegion) -> Bool -
Undocumented
Declaration
Swift
public override func isEqual(_ object: Any?) -> Bool -
Undocumented
Declaration
Swift
public override var hash: Int { get }
View on GitHub