CLError

public struct CLError : CustomNSError, Hashable, Error

Represents errors that can occur when using CoreLocation. This struct conforms to CustomNSError, Hashable, and Error. Apple Documentation

  • The associated NSError instance.

    Declaration

    Swift

    public let _nsError: NSError
  • Initializes CLError from an NSError instance.

    Declaration

    Swift

    public init(_nsError: NSError)

    Parameters

    _nsError

    An existing NSError instance.

  • Initializes CLError from a CLError.Code.

    Declaration

    Swift

    public init(_ code: CLError.Code)

    Parameters

    code

    The error code.

Error Domain

CLError.Code

  • Defines specific error codes that can occur within CoreLocation. Apple Documentation

    See more

    Declaration

    Swift

    public enum Code : Int, @unchecked Sendable, Equatable

Static Error Codes

Alternate Region

  • In a regionMonitoringResponseDelayed error, this property provides an alternative region that the location services can more effectively monitor.

    Note

    Unavailable in visionOS.

    Declaration

    Swift

    @available(visionOS, unavailable)
    public var alternateRegion: CLRegion? { get }