Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to list currently active gesture recognizers?

I'd like to be able to list all currently active gesture recognizers (so I can temporarily disable them). Is this possible somehow?

like image 235
EarlGrey Avatar asked Mar 02 '12 18:03

EarlGrey


People also ask

How do the gesture recognizers work?

The gesture recognizers built by factories in this set participate in the gesture arena for each pointer that was put down on the widget. If any of these recognizers win the gesture arena, the entire pointer event sequence starting from the pointer down event will be dispatched to the platform view.

How to call the event handler from a gesture recognizer?

When the gesture recognizer detects the gesture, it will call the event handler method on the target. Declare the method you want called by the gesture recognizer. Gesture recognizers call the same selector as it transitions through various states.

How do I attach a gesture recognizer to a viewcontroller?

Drag a Gesture recognizer from the Object Library and drop it onto the View you want the Gesture to be attached to. NOTE: You can see which view the Gesture Recognizer is attached to by ctrl + Clicking on the Gesture Recognizer in the Document Outline. Ctrl-drag from your Gesture Recognizer to the ViewController swift file to create an action.

Is it possible to make a semi-transparent tap gesture recognizer?

This is not nessesary for elements which natively support input, such as a Button. This example creates a tap gesture recognizer and associates it with an image. When the image is double tapped, it will become semi-transparent.


1 Answers

Use the UIView's gestureRecognizers property:

for (UIGestureRecognizer *recognizer in self.gestureRecognizers)
{
    //Do something with recognizer
}

More reading: UIView

like image 116
Jeremy Avatar answered Oct 12 '22 01:10

Jeremy