summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSExpression+MGLAdditions.h
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2019-03-15 16:10:27 -0700
committerGitHub <noreply@github.com>2019-03-15 16:10:27 -0700
commit7939ff213a98de055e93ddd893ccae40b82a7d16 (patch)
treef23371b62e4ce1e4964361a04c0b11a39ede8569 /platform/darwin/src/NSExpression+MGLAdditions.h
parentc8cfdb1ced822711e772dfcc8f708b1a7a68b5fc (diff)
downloadqtlocation-mapboxgl-7939ff213a98de055e93ddd893ccae40b82a7d16.tar.gz
[ios, macos] Add format expression convenience methods support. (#14094)
Added the ios/macos format expression bindings. The equivalent is mgl_attributed: or mgl_attributed({}) when making an expression using the expressionForFormat selector. A new constructor called mgl_expressionForAttributedExpressions:(NSArray<NSExpression*>*)attributedExpressions was added to NSExpression+MGLAdditions category. Updated the symbol style layer text test to use the bindings. Updated the Predicates and Expressions.md and For Style Authors.md.ejs template with the bindings.
Diffstat (limited to 'platform/darwin/src/NSExpression+MGLAdditions.h')
-rw-r--r--platform/darwin/src/NSExpression+MGLAdditions.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/darwin/src/NSExpression+MGLAdditions.h b/platform/darwin/src/NSExpression+MGLAdditions.h
index 1e6fd6fc46..a19ec1af2e 100644
--- a/platform/darwin/src/NSExpression+MGLAdditions.h
+++ b/platform/darwin/src/NSExpression+MGLAdditions.h
@@ -7,6 +7,8 @@
#import "MGLTypes.h"
+@class MGLAttributedExpression;
+
NS_ASSUME_NONNULL_BEGIN
typedef NSString *MGLExpressionInterpolationMode NS_TYPED_ENUM;
@@ -150,6 +152,14 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI
*/
+ (instancetype)mgl_expressionForMatchingExpression:(nonnull NSExpression *)inputExpression inDictionary:(nonnull NSDictionary<NSExpression *, NSExpression *> *)matchedExpressions defaultExpression:(nonnull NSExpression *)defaultExpression NS_SWIFT_NAME(init(forMGLMatchingKey:in:default:));
+/**
+ Returns an attributed function expression specifying an `MGLAttributedExpression` constant
+ expression array.
+
+ @param attributedExpressions The `MGLAttributedExpression` constant expression array.
+ */
++ (instancetype)mgl_expressionForAttributedExpressions:(nonnull NSArray<NSExpression *> *)attributedExpressions NS_SWIFT_NAME(init(forAttributedExpressions:));
+
#pragma mark Concatenating String Expressions
/**