-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Replace styleID property with styleURL__ inspectable #2632
Replace styleID property with styleURL__ inspectable #2632
Conversation
Before merging, I need to address invalid URLs by asserting. |
I'm on the record as being not un-in-favor of huge version numbers. Will give this a spin tomorrow! |
The new styleURL__ inspectable property is carefully named to masquerade as a URL property in Interface Builder, even though IB supports no such thing. If the user enters an invalid URL into the “Style URL” inspectable, throw an error instead of silently setting the style to the default. This check is not required in -setStyleURL:, which takes a real NSURL.
96dcb92
to
4f50928
Compare
Looks good and works in practice. 👍 |
Question: we are considering bumping to |
As explained above, we could have a non-inspectable property with the old name, as a compatibility shim. However, that’s no way to deprecate a symbol: developers will never see any indication that This is a unique case, and I think the set of inspectables we’ll have after landing this change will be pretty stable for awhile, modulo any Interface Builder enhancements to their inspectable support. |
Is this change going to be reflected in the Android SDK? |
The Android SDK has never had an independent |
A hack atop the hack added in #2632. Pre-declare `styleURL__` with an attribute that prevents it from appearing in code completion suggestions, while leaving it available to Interface Builder, which is unable to parse attributes.
A hack atop the hack added in #2632. Pre-declare `styleURL__` with an attribute that prevents it from appearing in code completion suggestions, while leaving it available to Interface Builder, which is unable to parse attributes.
This PR replaces the
styleID
convenience property with an Interface Builder inspectable (normally inaccessible from code) that imitates a URL field.styleID
is inconsistent with other GL-based APIs, and we never implemented a convenience initializer that took astyleID
anyways, so it had limited usefulness as a separate property.The new inspectable’s name is a horrible hack and is marked as such. I’ve filed <rdar://problem/23134321> against Interface Builder to request support for NSURL-typed inspectables.
I considered merely deprecating
styleID
but wound up cutting over in a manner similar to #1561.styleID
is primarily used as an inspectable. Deprecating an inspectable leads to a horrible user experience, because the inspectable’s value continues to work even though it silently disappears from the Attributes inspector. (You’d have to know to go to the User Defined Runtime Attributes section of the Identity inspector.) If you ever tried to re-set the style, this time via the new “Style URL” inspectable, you might run into weirdness like #2626. This backwards-incompatible change requires bumping the version up to 3.0.0.This PR also removes some APIs that have been marked unavailable for a few releases, since back before the iOS SDK left the 0.x series.
Fixes #2628.
/cc @jfirebaugh @incanus @bsudekum @friedbunny