DistanceFormatter
public class DistanceFormatter: LengthFormatter
Provides appropriately formatted, localized descriptions of linear distances.
-
Intializes a new
DistanceFormatter.Declaration
Swift
public init(approximate: Bool = false, forVoiceUse: Bool = false)Parameters
approximateapproximates the distances.
forVoiceUseIf true, the returned string will contain strings for some numbers like fractions. This is helpful for some speech synthesizers.
-
Returns a more human readable
Stringfrom a givenCLLocationDistance.The user’s
Localeis used here to set the units.Declaration
Swift
public func string(from distance: CLLocationDistance) -> String
Install in Dash
DistanceFormatter Class Reference