summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLDistanceFormatter.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLDistanceFormatter.h')
-rw-r--r--platform/darwin/src/MGLDistanceFormatter.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLDistanceFormatter.h b/platform/darwin/src/MGLDistanceFormatter.h
new file mode 100644
index 0000000000..46aad9a940
--- /dev/null
+++ b/platform/darwin/src/MGLDistanceFormatter.h
@@ -0,0 +1,26 @@
+#import <Foundation/Foundation.h>
+#import <CoreLocation/CoreLocation.h>
+
+#import "MGLFoundation.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `MGLDistanceFormatter` implements a formatter object meant to be used for
+ geographic distances. The user’s current locale will be used by default
+ but it can be overriden by changing the locale property of the numberFormatter.
+ */
+MGL_EXPORT
+@interface MGLDistanceFormatter : NSLengthFormatter
+
+/**
+ Returns a localized formatted string for the provided distance.
+
+ @param distance The distance, measured in meters.
+ @return A localized formatted distance string including units.
+ */
+- (NSString *)stringFromDistance:(CLLocationDistance)distance;
+
+@end
+
+NS_ASSUME_NONNULL_END