ios - @selector in UIPinchGesture is not called -


i had detected 2 finger touch imageview , given condition if 2 finger touched pinchgesture have perform selector imageview.

if ([[event alltouches]count] == 2)     {         imageview.multipletouchenabled=yes;         imageview.userinteractionenabled =yes;         twofingerpinch = [[uipinchgesturerecognizer alloc]initwithtarget:self action:@selector(twofingerpinch:)];     }  - (void)twofingerpinch:(uipinchgesturerecognizer *)recognizer {     cgfloat scale = recognizer.scale;     imageview.transform = cgaffinetransformscale(imageview.transform, scale, scale);     recognizer.scale = 1.0; } 

but twofingerpinch method not called. me!! in advance.

as per code hard on view want apply pinch gesture,i considering applying on imageview, here how should it:-

-(void)viewdidload { uipinchgesturerecognizer * pinch = [[uipinchgesturerecognizer alloc]initwithtarget:self action:@selector(twofingerpinch:)]; [imageview addgesturerecognizer:pinch]; [imageview setuserinteractionenabled:yes]; pinch.delegate = self; }  - (void)twofingerpinch:(uipinchgesturerecognizer *)recognizer {     cgfloat scale = recognizer.scale;     imageview.transform = cgaffinetransformscale(imageview.transform, scale, scale);     recognizer.scale = 1.0; }  - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldrecognizesimultaneouslywithgesturerecognizer:(uigesturerecognizer *)othergesturerecognizer {  return no;    } 

Comments