Repository navigation
Make style properties null-resettable; fix property function roundtripping - #6168
Conversation
|
Every enumeration-typed property test is failing on the iOS build bot: However, I’m unable to reproduce this failure locally. |
If the property is unset, return the default value. Fixes #6126.
5bd4ad8 to
34901b0
Compare
|
The test failures turned out to be legitimate. The tests caught yet another roundtripping issue. |
There was a problem hiding this comment.
Nit: it seems to me that the iOS variant should come before macOS’s.
There was a problem hiding this comment.
Rest assured, I was being completely objective and dispassionate by alphabetizing the items in this list. 😉
There was a problem hiding this comment.
The entire declaration and its comment are now duplicated once per platform using conditional compilation macros. Each comment says only NSColor or UIColor as appropriate. Out of respect for iOS’s primacy, the UIKit version comes first.
|
Other than my iOS partisanship, this LGTM. 👍 |
The documentation for runtime style API properties now spells out the value of the default type, to help developers infer the type of the property itself.
Also support unsetting enumeration-typed properties.
Duplicate each color-typed property once per platform using conditional compilation macros. Let’s just hope we never have to throw CGColor into the mix.
34901b0 to
f4be826
Compare
This PR includes several interwoven changes, all related to the runtime styling API:
null_resettablein Objective-C and therefore implicitly unwrapped optionals in Swift. Instead of returningnilwhen unset, these properties now return the intrinsic default value. (Fixes MGLStyleLayer properties should be null_resettable or nonnull #6126.)nil. (Fixes Getters for enumeration-typed style properties return nil instead of functions #6161.)/cc @frederoni