summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLClockDirectionFormatter.h
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-23 10:35:59 -0700
commit3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5 (patch)
tree9f0faeb5af456dc559b48d114883b2f6771400ba /platform/darwin/src/MGLClockDirectionFormatter.h
parent2d32336a41dac77b6182642b7067a23add12eb09 (diff)
downloadqtlocation-mapboxgl-3e22369f27ba4a0b1273c8934bfb0f59d9aa96c5.tar.gz
[ios, osx] Eliminated platform/{ios,osx}/include
Also updated various project references to be group-relative, so Xcode chooses the right directory by default when adding a new file. Fixes #4770.
Diffstat (limited to 'platform/darwin/src/MGLClockDirectionFormatter.h')
-rw-r--r--platform/darwin/src/MGLClockDirectionFormatter.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLClockDirectionFormatter.h b/platform/darwin/src/MGLClockDirectionFormatter.h
new file mode 100644
index 0000000000..e748a15847
--- /dev/null
+++ b/platform/darwin/src/MGLClockDirectionFormatter.h
@@ -0,0 +1,52 @@
+#import <Foundation/Foundation.h>
+#import <CoreLocation/CoreLocation.h>
+
+#import "MGLTypes.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ The `MGLClockDirectionFormatter` class provides properly formatted descriptions
+ of headings relative to the user, known as <i>clock positions</i>. For
+ example, a value of `90` may be formatted as “3 o’clock”, depending on the
+ locale.
+
+ Use this class to create localized heading strings when displaying directions
+ relative to the user’s current location and heading. To format a direction
+ irrespective of the user’s orientation, use `MGLCompassDirectionFormatter`
+ instead.
+ */
+@interface MGLClockDirectionFormatter : NSFormatter
+
+/**
+ The unit style used by this formatter.
+
+ This property defaults to `NSFormattingUnitStyleMedium`.
+ */
+@property (nonatomic) NSFormattingUnitStyle unitStyle;
+
+/**
+ The locale of the receiver.
+
+ The locale determines the output language and numeral system of the output.
+ */
+@property (copy) NSLocale *locale;
+
+/**
+ Returns a clock position string for the provided value.
+
+ @param direction The heading, measured in degrees, where 0° means “straight
+ ahead” and 90° means “directly to your right”.
+ @return The clock position string appropriately formatted for the receiver’s
+ locale.
+ */
+- (NSString *)stringFromDirection:(CLLocationDirection)direction;
+
+/**
+ This method is not supported for the `MGLDirectionFormatter` class.
+ */
+- (BOOL)getObjectValue:(out id __nullable * __nullable)obj forString:(NSString *)string errorDescription:(out NSString * __nullable * __nullable)error;
+
+@end
+
+NS_ASSUME_NONNULL_END