I have an UIView that contains two UIImageView (one is a cartoon, the other one its special shadow). "self" is the UIView object.
On tap I want to remove the UIView from its superview via a curl effect. This works very fine.
But before it is curled up, I want to remove my custom made shadow UIImageView, so that my shadow doesn't curl together with the curl effect shadow. Removing the UIImageView from the UIView right BEFORE the animation just does not work.
My code:
[myShadow setImage:nil];
[UIView transitionWithView:self duration:1.0
options:UIViewAnimationOptionTransitionCurlUp
animations:^ { [self setHidden:YES];}
completion:nil];
This doesn't remove myShadow. When I comment out the transitionWithView myShadow is removed just fine, but - of course- there is no animation following.
With the animation following the setImage:nil doesn't show any effect. I also tried [myShadow removeFromSuperview] and [myShadow release], also didn't do anything.
I was trying a lot of things and googling for over 3 hours. For example I tried
[self setNeedsDisplay];
or
animations:^ { [myShadow setImage:nil]; [self setHidden:YES];}
I played with this, but didn't get myShadow to disappear before the animation.
What can I do? Thank you.