DistanceFormatter

public class DistanceFormatter: LengthFormatter

Provides appropriately formatted, localized descriptions of linear distances.

  • Intializes a new DistanceFormatter.

    Declaration

    Swift

    public init(approximate: Bool = false)

    Parameters

    approximate

    approximates the distances.

  • Returns a more human readable String from a given CLLocationDistance.

    The user’s Locale is used here to set the units.

    Declaration

    Swift

    public func string(from distance: CLLocationDistance) -> String