CompassDirectionFormatter
public class CompassDirectionFormatter
The CompassDirectionFormatter
class provides properly formatted
descriptions of absolute compass directions. For example, a value of 90
may
be formatted as “east”, depending on the locale.
-
See moreStyle
is used to configure how aCompassDirectionFormatter
translates a compass direction into aString
.Declaration
Swift
public enum Style : Hashable
-
The
Style
used by this formatter. Defaults toStyle.long
.Declaration
Swift
public var style: CompassDirectionFormatter.Style
-
Creates a new
CompassDirectionFormatter
instanceDeclaration
Swift
public init()
-
Returns a localized string describing the provided compass direction.
Declaration
Swift
public func string(from direction: CLLocationDirection) -> String
Parameters
direction
A compass direction, measured in degrees, where 0° means “due north” and 90° means “due east”.
Return Value
A localized
String
describing the provideddirection