Learn how gesture recognizers interact with UIKit controls such as buttons switches and sliders.
Gesture recognizers attached to your views do not impact the ability of UIKit controls to handle events. Events occurring within the bounds of a control are handled by the control first, giving the control a chance to call its action method. Specifically, UIKit controls call their action method in the following situations:
A single finger swipe occurs on the knob of a
UISliderobject, in a direction parallel to the slider.
A single finger pan occurs on the knob of a
UISwitchobject, in a direction parallel to the switch.
To handle any of the preceding gestures before the control calls its action method, install your gesture recognizer on the control itself. Gesture recognizers handle touch events before the views to which they are attached. As a result, installing a gesture recognizer directly on a control prevents that control from calling its action method.