ReactiveCocoaLayout icon indicating copy to clipboard operation
ReactiveCocoaLayout copied to clipboard

Bind to hidden and alpha/alphaValue simultaneously

Open jspahrsummers opened this issue 12 years ago • 2 comments

A binding to rcl_alpha or rcl_alphaValue could automatically flip hidden based on the alpha value.

On iOS, this would mostly just make the hidden property more useful, since there should be no performance difference between alpha = 0 and hidden = YES.

On OS X, however, this would be useful in conjunction with #28. Basically, you could animate the alpha even for a view that's not layer-backed (while resting). rcl_alphaValue could simply translate into hidden, but then a binding could enable layer-backing, animate the alpha, and disable layer-backing once finished.

jspahrsummers avatar Dec 23 '12 06:12 jspahrsummers

According to an SO comment

by setting view.alpha = 0.0f, iOS also sets view.hidden = yes internally, in fact, there is a
threshold for alpha (0.1f), for alpha values smaller than this threshold, view.hidden gets set to YES.

zakdances avatar May 10 '13 18:05 zakdances

@zakdances As I pointed out above, we wouldn't do this as an optimization (because it wouldn't be one). It would be strictly to make view.hidden more meaningful, as well as to support layer-backing magic on OS X.

jspahrsummers avatar May 15 '13 05:05 jspahrsummers