ios issue with 3d animations
I'm trying to 3D animate an UIImageView on X axis so it will do a 180 degrees rotation. At 90 degres I want to change the image. (that is why i "broke" the animation in 2).

Animation works well, but the problem is that the second image is drawn upside down. Any ideas what should i do for the image to be drawn normal?

Here is my code

    	i++;
	[UIView animateWithDuration:2 animations:^{

		self.imageView.layer.transform = CATransform3DMakeRotation(-M_PI/2 , 1, 0,0);
		
	} completion:^(BOOL finished){

		UIImage *bottomI = (UIImage *)[bottom objectAtIndex:i];
		self.second.image =bottomI;

		[UIView animateWithDuration:2 animations:^{

		      imageView.layer.transform = CATransform3DMakeRotation(M_PI , 1, 0,0);

		} completion:^(BOOL finised){	
			
		}];
		
	}];
ios issue with 3d animations
===

I'm trying to 3D animate an UIImageView on X axis so it will do a 180 degrees rotation. At 90 degres I want to change the image. (that is why i "broke" the animation in 2).

Animation works well, but the problem is that the second image is drawn upside down. Any ideas what should i do for the image to be drawn normal?

Here is my code

    	i++;
	[UIView animateWithDuration:2 animations:^{

		self.imageView.layer.transform = CATransform3DMakeRotation(-M_PI/2 , 1, 0,0);
		
	} completion:^(BOOL finished){

		UIImage *bottomI = (UIImage *)[bottom objectAtIndex:i];
		self.second.image =bottomI;

		[UIView animateWithDuration:2 animations:^{

		      imageView.layer.transform = CATransform3DMakeRotation(M_PI , 1, 0,0);

		} completion:^(BOOL finised){	
			
		}];
		
	}];