In my project, I do the following in UIImageView 1.) rotate it 2.) move it 3.) increase it. My project also has a button with the name "New" that will reset all the settings for the app.my problem in that if I rotate the image and click on the new button, the UIImageVIew setting will not change. maybe someone has an idea. thanks in advance
-(void)rotate:(id)sender {
if([(UIRotationGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded) {
lastRotation = 0.0;
return;
}
CGFloat rotation = 0.0 - (lastRotation - [(UIRotationGestureRecognizer*)sender rotation]);
CGAffineTransform oldTransform = [(UIPinchGestureRecognizer*)sender view].transform;
CGAffineTransform newTransform = CGAffineTransformRotate(oldTransform,rotation);
[[(UIRotationGestureRecognizer*)sender view] setTransform:newTransform];
lastRotation = [(UIRotationGestureRecognizer*)sender rotation];
}
Above is the code that I use for rotation.
source
share