summaryrefslogtreecommitdiff
path: root/platform/darwin/test/MGLDocumentationExampleTests.swift
diff options
context:
space:
mode:
authorFabian Guerra Soto <fabian.guerra@mapbox.com>2019-03-22 13:45:39 -0700
committerFabian Guerra Soto <fabian.guerra@mapbox.com>2019-03-22 15:08:58 -0700
commit79582487aa69569933e38cadc0faf5ea04711303 (patch)
tree7f44ae7c6654171fd58faaafd6bfd3ab7e9306aa /platform/darwin/test/MGLDocumentationExampleTests.swift
parentbe46a707f992ce48e65163353924e0d7be25c722 (diff)
downloadqtlocation-mapboxgl-79582487aa69569933e38cadc0faf5ea04711303.tar.gz
[ios, macos] Support expressions in formatting parameters. (#14198)
Modified MGLAttributedExpression object to support NSExpressions as formatting attributes only. This aligns with GL and Android implementation and specification. Modified the documentation accordingly, and changed MGLFontSizeAttribute to MGLFontScaleAttribute to clarify the true function of the formatting parameter.
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r--platform/darwin/test/MGLDocumentationExampleTests.swift8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift
index 45efe4c591..2a64fbc601 100644
--- a/platform/darwin/test/MGLDocumentationExampleTests.swift
+++ b/platform/darwin/test/MGLDocumentationExampleTests.swift
@@ -550,10 +550,10 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate {
let redColor = UIColor.red
#endif
let expression = NSExpression(forConstantValue: "Foo")
- let attributes: Dictionary<MGLAttributedExpressionKey, Any> = [.fontNamesAttribute : ["DIN Offc Pro Italic",
- "Arial Unicode MS Regular"],
- .fontSizeAttribute: 1.2,
- .fontColorAttribute: redColor]
+ let attributes: [MGLAttributedExpressionKey: NSExpression] = [.fontNamesAttribute : NSExpression(forConstantValue: ["DIN Offc Pro Italic",
+ "Arial Unicode MS Regular"]),
+ .fontScaleAttribute: NSExpression(forConstantValue: 1.2),
+ .fontColorAttribute: NSExpression(forConstantValue: redColor)]
let attributedExpression = MGLAttributedExpression(expression, attributes:attributes)
//#-end-example-code