CLLocationManager

open class CLLocationManager : NSObject

The object you use to start and stop the delivery of location-related events to your app. Apple Documentation

Delegates and Authorization

Configuration Properties

Location and Heading Properties

Monitoring and Ranging

Service Integration

  • Undocumented

    Declaration

    Swift

    public override init()

Authorization Methods

Location Management

Heading Management

  • Starts the generation of updates that report the user’s current heading.

    Note

    Heading updates require magnetometer hardware which is not available on Linux. This method is a no-op on Linux platforms and will not generate heading updates. Use headingAvailable() to check if heading services are available. Apple Documentation

    Declaration

    Swift

    open func startUpdatingHeading()
  • Stops the generation of heading updates.

    Note

    This method is a no-op on Linux platforms since heading updates are not supported. Apple Documentation

    Declaration

    Swift

    open func stopUpdatingHeading()

Region Monitoring

  • Starts monitoring the specified region for entry and exit events.

    Note

    The region’s notifyOnEntry and notifyOnExit properties determine which events are reported. Apple Documentation

    Declaration

    Swift

    open func startMonitoring(for region: CLRegion)

    Parameters

    region

    The region to monitor. Only CLCircularRegion is supported.

  • Stops monitoring the specified region.

    Declaration

    Swift

    open func stopMonitoring(for region: CLRegion)

    Parameters

    region

    The region to stop monitoring. Apple Documentation

  • Requests the current state of the specified region.

    Note

    This method triggers the locationManager(_:didDetermineState:for:) delegate method. Apple Documentation

    Declaration

    Swift

    open func requestState(for region: CLRegion)

    Parameters

    region

    The region whose state you want to determine.

Service Availability

  • Returns a Boolean value indicating whether location services are enabled on the device.

    Declaration

    Swift

    open class func locationServicesEnabled() -> Bool
  • Returns a Boolean value indicating whether the location manager is able to generate heading-related events.

    Declaration

    Swift

    open class func headingAvailable() -> Bool

    Return Value

    Always returns false on Linux platforms as magnetometer hardware is not available. Apple Documentation

  • Returns a Boolean value indicating whether the significant-change location service is available on the device.

    Declaration

    Swift

    open class func significantLocationChangeMonitoringAvailable() -> Bool

    Return Value

    Always returns false on Linux platforms as this service requires OS-level support not available on Linux. Apple Documentation

  • Returns a Boolean value indicating whether the device supports region monitoring using the specified class.

    Declaration

    Swift

    open class func isMonitoringAvailable(for regionClass: AnyClass) -> Bool

    Parameters

    regionClass

    The class of region to check support for.

    Return Value

    Returns true for CLCircularRegion, false for other region types as only circular regions are supported in OpenCoreLocation. Apple Documentation

  • Returns a Boolean value indicating whether the device supports ranging of beacons that use the iBeacon protocol.

    Declaration

    Swift

    open class func isRangingAvailable() -> Bool

    Return Value

    Always returns false on Linux platforms as beacon ranging requires Bluetooth LE hardware integration. Apple Documentation