DistanceLabel
open class DistanceLabel : UILabel
A label to display distances.
The text is displated in meters if is less than 1km (for instance “980m”) and in km with two decimals if it is larger than 1km (for instance “1.20km”).
If useImperial
is true, it displays the distance always in miles (“0.23mi”).
To update the text displayed set the distance
property.
-
Internal variable that keeps the actual distance
Declaration
Swift
private var _distance: Double
-
Internal variable to keep the use of imperial units
Declaration
Swift
private var _useImperial: Bool
-
Use imperial units (miles)? False by default. If true, displays meters and kilometers
Declaration
Swift
open var useImperial: Bool { get set }
-
Distance in meters
Declaration
Swift
open var distance: CLLocationDistance { get set }