Open evil159 opened 5 years ago
Hi @evil159 Thanks for pointing that out, I remember this being added in another PR a while ago, as a fix for the issue you mentioned, #257 I'm unable to test it thoroughly now, can you confirm that the flicker is gone and doesn't introduce regressions?
Fix for #367.
Motivation
After investigating this and testing on iOS's 8-12 I could not observe that recursive subview actually does anything(except causing flickering on iOS 11 and 12 :).
Bar button items(including those with custom views) are handled by these:
Title and title view handled here:
Any other "tintable" stuff handled here
It seems that all cases are covered already without the need to traverse navigation bar view hierarchy updating alpha for each of them(which also has it's problems).
Issue with recursive alpha
As the documentation for
UIView.alpha
statesWhich results in alpha value of a view being multiplied by alpha of its superview(and superview of superview and so on). In this illustration you can see what I'm trying to describe:
The first square consists of a white view with alpha
0.5
and a black subview with alpha0.5
. Square two and three are just for comparison - the first one is a black view with alpha 0.25, second one - 0.5. This shows that recursively applying alpha produces result different from desired - in an attempt to set everything to0.5
- the result ended up looking as if it has alpha of value0.25
. And this is in controlled environment - view hierarchy depth is limited to 2 in this example, this should be more pronounced when nesting is deeper, the alpha of the deepest view should be desired_alpha^depth.Here's playground with this setup: RecursiveAlphaPlayground.playground.zip