How can I check if an appearance property has been set?

Is there a way to check if a property has been set on an UIAppearance proxy or not?

Let’s say I want to do something like:

self.lineWidth = appearance.lineWidth ? : kDefaultLineWidth;

This will not work correctly if the lineWidth was set to zero on the proxy since it would be indistinguishable from not having been set at all (assuming it’s a CGFloat).


Source: ios

Leave a Reply