ReactiveCocoaLayout
ReactiveCocoaLayout copied to clipboard
Bind to hidden and alpha/alphaValue simultaneously
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.
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 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.