From 9d368ea98d096c1eed2c1eb7edc4a37ff31b03b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Thu, 25 Aug 2016 21:59:55 -0700 Subject: [ios, macos] Mark MGLStyleLayer properties null_resettable If the property is unset, return the default value. Fixes #6126. --- platform/darwin/src/MGLStyleLayer.h.ejs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'platform/darwin/src/MGLStyleLayer.h.ejs') diff --git a/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/darwin/src/MGLStyleLayer.h.ejs index 870c6a45c9..2b36a3067a 100644 --- a/platform/darwin/src/MGLStyleLayer.h.ejs +++ b/platform/darwin/src/MGLStyleLayer.h.ejs @@ -40,13 +40,16 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope <% for (const property of layoutProperties) { -%> /** - <%- propertyDoc(property, type) %><% if ('default' in property) { %> + <%- propertyDoc(property, type) %> +<% if ('default' in property) { -%> - <% if (property.required) { %>The default value of this property is <%= propertyDefault(property, type) %>.<% } else { %>If this property is set to `nil`, the layer uses an implicit default value of <%= propertyDefault(property, type) %>.<% } %><% } %><% if (property.requires) { %> + The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %> +<% } if (property.requires) { -%> - <%= propertyReqs(property, layoutPropertiesByName, type) %><% } %> + <%- propertyReqs(property, layoutPropertiesByName, type) %> +<% } -%> */ -@property (nonatomic<% if (!property.required) { %>, nullable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; +@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> <% } -%> @@ -54,13 +57,16 @@ typedef NS_ENUM(NSUInteger, MGL<%- camelize(type) %>StyleLayer<%- camelize(prope <% for (const property of paintProperties) { -%> /** - <%- propertyDoc(property, type) %><% if ('default' in property) { %> + <%- propertyDoc(property, type) %> +<% if ('default' in property) { -%> - <% if (property.required) { %>The default value of this property is <%= propertyDefault(property, type) %>.<% } else { %>If this property is set to `nil`, the layer uses an implicit default value of <%= propertyDefault(property, type) %>.<% } %><% } %><% if (property.requires) { %> + The default value of this property is <%- propertyDefault(property, type) %>.<% if (!property.required) { %> Set this property to `nil` to reset it to the default value.<% } %> +<% } if (property.requires) { -%> - <%= propertyReqs(property, paintPropertiesByName, type) %><% } %> + <%- propertyReqs(property, paintPropertiesByName, type) %> +<% } -%> */ -@property (nonatomic<% if (!property.required) { %>, nullable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; +@property (nonatomic<% if (!property.required) { %>, null_resettable<% } %>) <%- propertyType(property, false, type) %> <%- camelizeWithLeadingLowercase(property.name) %>; <% } -%> @end -- cgit v1.2.1