SendableCLLocation
public struct SendableCLLocation : Sendable, CustomStringConvertible, CustomDebugStringConvertible
A thread-safe, sendable representation of CLLocation
.
This struct is designed to encapsulate the key properties of CLLocation
while ensuring it is safe to use in concurrent and isolated execution contexts.
-
The latitude of the location.
Declaration
Swift
public let latitude: Double
-
The longitude of the location.
Declaration
Swift
public let longitude: Double
-
The altitude of the location in meters.
Declaration
Swift
public let altitude: Double
-
The horizontal accuracy of the location in meters.
Declaration
Swift
public let horizontalAccuracy: Double
-
The vertical accuracy of the location in meters.
Declaration
Swift
public let verticalAccuracy: Double
-
The timestamp when the location was determined.
Declaration
Swift
public let timestamp: Date
-
The course of the device in degrees relative to true north.
- Range:
0.0
-359.9
degrees (0
being true north). Negative if course is invalid.
Declaration
Swift
public let course: Double
- Range:
-
The accuracy of the course measurement in degrees.
Declaration
Swift
public let courseAccuracy: Double
-
The speed of the device in meters per second.
Declaration
Swift
public let speed: Double
-
The accuracy of the speed measurement in meters per second.
Declaration
Swift
public let speedAccuracy: Double
-
init(latitude:
longitude: altitude: horizontalAccuracy: verticalAccuracy: course: courseAccuracy: speed: speedAccuracy: timestamp: ) Initializes a new
SendableCLLocation
instance.Declaration
Swift
public init( latitude: Double, longitude: Double, altitude: Double = 0.0, horizontalAccuracy: Double = 0.0, verticalAccuracy: Double = 0.0, course: Double = -1.0, courseAccuracy: Double = -1.0, speed: Double = -1.0, speedAccuracy: Double = -1.0, timestamp: Date = Date() )
-
Returns a user-friendly string representation of the location.
Declaration
Swift
public var description: String { get }
-
Returns a detailed string representation for debugging.
Declaration
Swift
public var debugDescription: String { get }
-
Initializes a
SendableCLLocation
from aCLLocation
Declaration
Swift
public init(from location: CLLocation)
-
Converts the
SendableCLLocation
back into aCLLocation
Declaration
Swift
public func toCLLocation() -> CLLocation