To rotate an image you can use UIPanGestureRecognizer and to zoom in/out you can use UIPinchGestureRecognizer. May be the code below could help you.
// In your vieDidLoad use:
UIPanGestureRecognizer *pan=[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panned:)];
UIPinchGestureRecognizer *pinch=[[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(pinched:)];
[self.imageview addGestureRecognizer:pinch];
[self.imageview addGestureRecognizer:pan];
and add the selector methods:
// To zoom in/out
- (void)pinched:(UIPinchGestureRecognizer *)sender {
if (sender.scale >1.0f && sender.scale < 2.5f) {
CGAffineTransform transform = CGAffineTransformMakeScale(sender.scale, sender.scale);
imageview.transform = transform;
}
}
//To rotate
-(void) panned:(UIGestureRecognizer *)gesture
{
CGPoint translatedPoint = [(UIPanGestureRecognizer*)gesture translationInView:imageview];
if([(UIPanGestureRecognizer*)gesture state] == UIGestureRecognizerStateBegan) {
_firstX = [imageview center].x;
_firstY = [imageview center].y;
}
translatedPoint = CGPointMake(_firstX+translatedPoint.x, _firstY+translatedPoint.y);
[imageview setCenter:translatedPoint];
}
in your viewDidLoad your should also add your frame as as subview to the imageview.