We currently use the MGLStyleAttributeValue protocol to allow any style attribute property to be set to the appropriate value type or an instance of MGLStyleAttributeFunction. While this approach is slightly more strongly typed than id, preventing the developer from setting a property to e.g. a UIButton, it doesn’t keep the developer from setting the property to an NSString where an NSNumber is expected or an NSArray where an NSValue is expected. The attribute properties’ types should be more specific, allowing the compiler to catch common developer errors.
/cc @frederoni @incanus @jfirebaugh
We currently use the MGLStyleAttributeValue protocol to allow any style attribute property to be set to the appropriate value type or an instance of MGLStyleAttributeFunction. While this approach is slightly more strongly typed than
id, preventing the developer from setting a property to e.g. a UIButton, it doesn’t keep the developer from setting the property to an NSString where an NSNumber is expected or an NSArray where an NSValue is expected. The attribute properties’ types should be more specific, allowing the compiler to catch common developer errors./cc @frederoni @incanus @jfirebaugh