I check from UIImageView's scaleY but it doesn't work (see the code below).
CGAffineTransform t = [myImageView transform]; // Keep matrix value of UIImageView
float scaleY1 = sqrt(t.b * t.b + t.d * t.d); // 1.0000
CGAffineTransform t2 = CGAffineTransformScale(t, 1, -1.0); // flip UIImageView vertically
float scaleY2 = sqrt(t2.b * t2.b + t2.d * t2.d); // 1.0000
[myImageView setTransform:t2];
NSLog(@"1: %f, 2: %f", scaleY1, scaleY2); // 1: 1.0000, 2: 1.0000
From above, you can see that before and after we flip the UIImageView, we got the same "scaleY value".
What is the value that we should check? (in order to detect when UIImageView flip vertically)
What about checking the transform property of the imageview? You will see there if the view has been transformed. This is what I see if I print the value of myImageView in console after aplying the transformation:
(lldb) po myImageView
UIImageView: 0x8f59f30; frame = (0 0; 0 0); transform = [1, 0, -0,
-1, 0, 0]; userInteractionEnabled = NO;
You can try this
[UIView transitionWithView: flipTile
duration: 0.5
options: UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
flipTile.image = newTileImage;
}
completion:^(BOOL finished) {
/*
code after completion
*/
}
];
The answer of jay gajjar is fine.
But if you dont want to animate then use
[UIView transitionWithView: flipTile
duration: 0.0
options: UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
flipTile.image = newTileImage;
}
completion:^(BOOL finished) {
/*
code after completion
*/
}
];