I want to use CATransition
to provide a fading animation between different states of a view. However, this doesn't seem to work with a single view (all examples I found use CATransition
to switch between different views). In contrast, a CABasicAnimation
works just fine.
My example code shows what I'm doing. I have a custom view (TTView
) with two properties I want to animate. One is a color, animated using CABasicAnimation
(simple interpolation). The other is a boolean state, and I want to achieve a fading effect when it changes. (Ignore the fact that the example uses it to just change a rectangle's size, that's just to keep it simple.)
Am I doing something wrong, or does CATransition
just not work within a single view?