Touch turn

I need to turn my eyes around with a circular touch of my finger ... I mean, how to dial the old phone number ... and the touch should only be at the corners ..... can anyone help me ... I have tried a lot ... but did not have time

enter image description here

+7
source share
1 answer

You need to define a UIRotationGestureRecognize in the view you want to rotate, and then add a selector method and implement it as follows.

Add this to you viewDidLoad method

 UIRotationGestureRecognizer *rotate = [[UIRotationGestureRecognizer alloc] initWithTarget:self action:@selector(rotation:)]; [myUIViewObject addGestureRecognizer:rotate]; [rotate release]; 

And then we implement the method.

 - (void) rotation:(UIRotationGestureRecognize *) sender { CGAffineTransform myTransform = CGAffineTransformMakeRotation(sender.rotation); sender.view.transform = myTransform; } 

PS. myUIViewObject can be any UIView object that you want to rotate.

Edit:

You will find a lot of information here:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/49847-how-find-angle-two-points.html

+11
source

All Articles