diff options
author | Jordan Kiley <jmkiley@users.noreply.github.com> | 2018-08-13 13:02:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 13:02:50 -0700 |
commit | 6ff7c3114a672b9d27beb2ea5d7f959d141c4f6c (patch) | |
tree | c04fad5c4ddfac313a9f7787ba73aa0bc436002c | |
parent | 4530aca765acdcf02d1c24eb06ee0baabba76eac (diff) | |
download | qtlocation-mapboxgl-6ff7c3114a672b9d27beb2ea5d7f959d141c4f6c.tar.gz |
Add info on using a keypath containing a dot to Predicates & Expressions guide (#12599)
* [ios, macos] Add examples for using a key path containing a dot
-rw-r--r-- | platform/darwin/docs/guides/Predicates and Expressions.md | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/platform/darwin/docs/guides/Predicates and Expressions.md b/platform/darwin/docs/guides/Predicates and Expressions.md index 90f010e954..b997f971f8 100644 --- a/platform/darwin/docs/guides/Predicates and Expressions.md +++ b/platform/darwin/docs/guides/Predicates and Expressions.md @@ -152,6 +152,18 @@ NSExpression(forFunction: "lowercase:", arguments: [NSExpression(forKeyPath: "ISO 3166-1:2006")]) ``` +If a feature attribute name contains a period, wrap the string in a +[`MGL_FUNCTION()`](#code-mgl_function-code). For a feature attribute named +`us.state`, you could use: + +```objc +[NSExpression expressionWithFormat: @"MGL_FUNCTION('get', 'us.state')"]; +``` + +```swift +NSExpression(format: "MGL_FUNCTION('get', 'us.state')") +``` + ### Functions Of the @@ -544,9 +556,9 @@ expression that contains references to those variables. An input expression, then any number of argument pairs, followed by a default expression. Each argument pair consists of a constant value followed by an expression to produce as a result of matching that constant value. - If the input value is an aggregate expression, then any of the constant values within - that aggregate expression result in the following argument. This is shorthand for - specifying an argument pair for each of the constant values within that aggregate + If the input value is an aggregate expression, then any of the constant values within + that aggregate expression result in the following argument. This is shorthand for + specifying an argument pair for each of the constant values within that aggregate expression. It is not possible to match the aggregate expression itself. </dd> </dl> @@ -720,9 +732,9 @@ operator in the Mapbox Style Specification. See also the <dd> The first argument is one of the following strings denoting curve types: <code>linear</code>, <code>exponential</code>, or <code>cubic-bezier</code>. - + The second argument is an expression providing parameters for the curve: - + <ul> <li>If the curve type is <code>linear</code>, the argument is <code>NIL</code>.</li> <li> @@ -737,7 +749,7 @@ operator in the Mapbox Style Specification. See also the cubic Bézier curve. </li> </ul> - + The third argument is an <code>NSDictionary</code> object representing the interpolation’s stops, with numeric zoom levels as keys and expressions as values. @@ -821,7 +833,7 @@ operator. The first argument is an expression that evaluates to a number, specifying the minimum value in case the target is less than any of the stops in the second argument. - + The second argument is an <code>NSDictionary</code> object representing the interpolation’s stops, with numeric zoom levels as keys and expressions as values. |