How can I flip an UIImageView?
I've edited Sound Blasters code a bit to return an UIImageView. However, this code does not allow you to flip the image vertically and horizontally at the same time. A fix for this should be rather easy though.
- (UIImageView *) flipImage:(UIImageView *)originalImage Horizontal:(BOOL)flipHorizontal {
if (flipHorizontal) {
originalImage.transform = CGAffineTransformMake(originalImage.transform.a * -1, 0, 0, 1, originalImage.transform.tx, 0);
}else {
originalImage.transform = CGAffineTransformMake(1, 0, 0, originalImage.transform.d * -1, 0, originalImage.transform.ty);
}
return originalImage; }