Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

removeGestureRecognizer method

I've created a UIButton with multiple Gestures. Is there a way to remove ALL gesture Recognizers? Without the gesture recognizer object? I've looked at this method:

[myButton removeGestureRecognizer:(GestureRecongizer)];

However I don't have the Gesture recognizer object anymore. Is there a way to clean out my gestures without the recognizer object? Similiar to:

[myButton removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents];
like image 401
ManOx Avatar asked May 14 '12 16:05

ManOx


1 Answers

this should do it

while (myButton.gestureRecognizers.count) {
    [myButton removeGestureRecognizer:[myButton.gestureRecognizers objectAtIndex:0]];
}
like image 159
Jason McTaggart Avatar answered Oct 24 '22 18:10

Jason McTaggart