VBDCompassDirectionFormatter
@interface VBDCompassDirectionFormatter : NSFormatter
The VBDCompassDirectionFormatter
class provides properly formatted
descriptions of absolute headings. For example, a value of 90
may be
formatted as “east”, depending on the locale.
Use this class to create localized heading strings when displaying directions
irrespective of the user’s current location. To format a direction relative to
the user’s current location, use VBDCompassDirectionFormatter
instead.
-
The unit style used by this formatter.
This property defaults to
NSFormattingUnitStyleMedium
.Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSFormattingUnitStyle unitStyle;
-
Returns a heading string for the provided value.
Declaration
Objective-C
- (nonnull NSString *)stringFromDirection:(CLLocationDirection)direction;
Parameters
direction
The heading, measured in degrees, where 0° means “due north” and 90° means “due east”.
Return Value
The heading string appropriately formatted for the formatter’s locale.
-
This method is not supported for the
VBDDirectionFormatter
class.Declaration
Objective-C
- (BOOL)getObjectValue:(out id _Nullable *_Nullable)obj forString:(nonnull NSString *)string errorDescription:(out NSString *_Nullable *_Nullable)error;