UIRotationGestureRecognizer en UIImageview

Cómo rotar UIImageView con dos fingure touch en iOS SDK … como sé que esto es muy simple, pero debido a que soy nuevo en esta tecnología, no puedo entender …

Cómo usar UIRotationGestureRecognizer para implementar esto …

Por favor ayúdame a resolver este problema…

Gracias.

Codifique esto en view did load o en la function de creación de image: m_ctrlImgVwShowImage – your's imageview

UIRotationGestureRecognizer *rotationRecognizer = [[[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotate:)] autorelease]; [rotationRecognizer setDelegate:self]; [m_ctrlImgVwShowImage addGestureRecognizer:rotationRecognizer]; //lastRotation is a cgfloat member variable -(void)rotate:(id)sender { if([(UIRotationGestureRecognizer*)sender state] == UIGestureRecognizerStateEnded) { _lastRotation = 0.0; return; } CGFloat rotation = 0.0 - (_lastRotation - [(UIRotationGestureRecognizer*)sender rotation]); CGAffineTransform currentTransform = m_ctrlImgVwShowImage.transform; CGAffineTransform newTransform = CGAffineTransformRotate(currentTransform,rotation); [m_ctrlImgVwShowImage setTransform:newTransform]; _lastRotation = [(UIRotationGestureRecognizer*)sender rotation]; }