I’m playing with Core Animation and I’m struggling with my last pet use case: rotating a card on the y-axis.
Here is how my view is setup:
- AceView
|
└- background-view (filling the frame with a white background)
|
└- UILabel and UIImageView views for the UI artifacts
The animation stuff is setup thanks to the CABasicAnimation class and applied on the AceView’s layer. Unfortunately the behavior is not as I expected:

The card rotates but what I wanted is that when we see the “backside” (transform.rotation.y > M_PI) of the view, we would see the “background-view” I mentioned above (i.e. on the picture above, the 3rd step would be completly white). At first I even thought that setting a background color to AceView would be sufficient, unfortunately no.
I must clearly miss something, could you explain me what?
EDIT: I can match my expectation using a transition using + (void)transitionFromView:(UIView *)fromView toView:(UIView *)toView duration:(NSTimeInterval)duration options:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion but still, if anybody can explain me why rotating over the y-axis does not show the white view when > M_PI I would be really glad.
CALayer by default draws both sides of a view being rotated by default. I would assume the reason you see a difference on the transitionFromView:ToView: is because your flipping from the front of the “fromView” to the front of the “toView”.