Click to pack
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initwithtarget:self Action: @selector (tick:)];
Number of fingers tapping the screen
tap.numberoftapsrequired = 1;
Several finger clicks
tap.numberoftouchesrequired = 1;
[Self.view Addgesturerecognizer:tap];
Long Press
Uilongpressgesturerecognizer *longpress = [[Uilongpressgesturerecognizer alloc]initwithtarget:self Action: @selector (loagpress:)];
Minimum number of seconds to press
Longpress.minimumpressduration = 3;
[Self.view addgesturerecognizer:longpress];
Swipe
Uiswipegesturerecognizer *swipe = [[Uiswipegesturerecognizer alloc]initwithtarget:self Action: @selector (swipe:)];
Direction of Swipe
Swipe.direction = Uiswipegesturerecognizerdirectionleft;
[Self.view Addgesturerecognizer:swipe];
Drag
Uipangesturerecognizer *pan = [[Uipangesturerecognizer alloc]initwithtarget:self Action: @selector (pan:)];
[Pan Requiregesturerecognizertofail:swipe];
[Self.view Addgesturerecognizer:pan];
Kneading
Uipinchgesturerecognizer *pinch = [[Uipinchgesturerecognizer alloc]initwithtarget:self Action: @selector (pinch:)];
[Self.view Addgesturerecognizer:pinch];
Rotating
Uirotationgesturerecognizer *rotation = [[Uirotationgesturerecognizer alloc]initwithtarget:self Action: @selector ( Rotation:)];
Rotation.rotation = 1;
[Self.view addgesturerecognizer:rotation];
}
-(void) TICK: (UITapGestureRecognizer *) tap
{
6, again out of the place to start this object to hang agent
Nextviewcontroller *next = [[Nextviewcontroller alloc]init];
Next.delegate = self;
//
[Self presentviewcontroller:next animated:yes completion:nil];
Imageview.transform = cgaffinetransformidentity;
Get the location of the tap screen
NSLog (@ "tap%f%f", [tap Locationinview:self.view].x,[tap locationinview:self.view].y);
Imageview.image = [UIImage imagenamed:@ "yu.jpg"];
Imageview.alpha = 1;
Imageview.center = [Tap LocationInView:self.view];
[UIView animatewithduration:0.5 animations:^{
Imageview.alpha = 0.01;
}];
}
-(void) mmmmmm
{
Imageview.image = [UIImage imagenamed:@ "yu.jpg"];
Imageview.alpha = 1;
}
-(void) Loagpress: (Uilongpressgesturerecognizer *) longpress
{
NSLog (@ "longpress%f%f", [longpress locationinview:self.view].x,[longpress locationinview:self.view].y);
}
-(void) Swipe: (Uiswipegesturerecognizer *) swipe
{
NSLog (@ "swipe%f%f", [swipe locationinview:self.view].x,[swipe locationinview:self.view].y);
Self.view.frame = CGRectMake (self.view.bounds.size.width, 0, Self.view.bounds.size.width, Self.view.bounds.size.height);
[UIView animatewithduration:0.8 animations:^{
Self.view.frame = CGRectMake (0, 0, self.view.bounds.size.width, self.view.bounds.size.height);
}];
}
-(void) pan: (Uipangesturerecognizer *) pan
{
Get the location of the drag
Imageview.image = [UIImage imagenamed:@ "yu.jpg"];
Imageview.alpha = 1;
Imageview.center = [Pan LocationInView:self.view];
}
-(void) Pinch: (Uipinchgesturerecognizer *) pinch
{
Imageview.image = [UIImage imagenamed:@ "yu.jpg"];
Imageview.alpha = 1;
Imageview.transform = Cgaffinetransformscale (Imageview.transform, Pinch.scale, Pinch.scale);
Scale of changes in kneading
Pinch.scale = 1;
}
-(void) Rotation: (Uirotationgesturerecognizer *) rotation
{
Imageview.image = [UIImage imagenamed:@ "yu.jpg"];
Imageview.alpha = 1;
Change the view rotation on a rotation gesture
Imageview.transform = Cgaffinetransformmakerotation (rotation.rotation);
}
Five big gestures