I am trying to rotate an image using slider..its working well but when i zoom in or zoom out that imageView using Pinch gesture and then try to rotate it using Slider then it resizes the imageView’s frame to its original frame and then rotate it..i Want it to rotate the new imageview after performing zoom operation…heres my code.
//for rotation
- (IBAction)sliderChanged:(id)sender
{
imageView.transform = CGAffineTransformMakeRotation(Slider.value * 2*M_PI / Slider.maximumValue);
}
//for zoom in zoom out
- (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer
{
recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale);
recognizer.scale = 1;
}
In
handlePinchyou correctly modify existing transform, but insliderChangedyou create new transform, losing scaling.