summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLStyleLayer.h.ejs
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLStyleLayer.h.ejs')
-rw-r--r--platform/darwin/src/MGLStyleLayer.h.ejs28
1 files changed, 28 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs
index 17529b8f9d..a10512dbcb 100644
--- a/platform/darwin/src/MGLStyleLayer.h.ejs
+++ b/platform/darwin/src/MGLStyleLayer.h.ejs
@@ -3,6 +3,7 @@
const type = locals.type;
const layoutProperties = locals.layoutProperties;
const paintProperties = locals.paintProperties;
+ const enumProperties = locals.enumProperties;
-%>
// This file is generated.
// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`.
@@ -116,4 +117,31 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(property.name) %>) {
<% } -%>
@end
+<% if (enumProperties) { -%>
+/**
+ Methods for wrapping an enumeration value for a style layer attribute in an
+ `MGL<%- camelize(type) %>StyleLayer` object and unwrapping its raw value.
+ */
+@interface NSValue (MGL<%- camelize(type) %>StyleLayerAdditions)
+
+#pragma mark Working with <%- camelize(type) %> Style Layer Attribute Values
+
+<% for (let property of enumProperties) { -%>
+/**
+ Creates a new value object containing the given `MGL<%- camelize(property.name) %>` enumeration.
+
+ @param <%- objCName(property) %> The value for the new object.
+ @return A new value object that contains the enumeration value.
+ */
++ (instancetype)valueWithMGL<%- camelize(property.name) %>:(MGL<%- camelize(property.name) %>)<%- objCName(property) %>;
+
+/**
+ The `MGL<%- camelize(property.name) %>` enumeration representation of the value.
+ */
+@property (readonly) MGL<%- camelize(property.name) %> MGL<%- camelize(property.name) %>Value;
+
+<% } -%>
+@end
+
+<% } -%>
NS_ASSUME_NONNULL_END