UIControl Not Receiving Touches

Check frames of all parent views. The rule is that if sub-view (or its part) of the view is outside the view bounds, it doesn't receive touch events.


Xcode 12 and Latter.

  • As mention in the accepted answer, make sure all the subviews of the UIControl view get "User Interaction Enabled" unchecked.
  • Select your UIControl view and switch to the "Connection Inspector" and make sure it has been connected to "Touch Up Inside" event. Sometimes Xcode uses "Value Changed" event so make sure to change to "Touch Up Inside" event

tl;dr Set all subviews of the UIControl to setUserInteractionEnabled:NO. UIImageViews have it set to NO by default.

Original Post

One thing I found recently is that it helps if the top-most subview of the UIControl has setUserInteractionEnabled:NO. I arrived at this because I had a UIControl subclass with a UIImageView as it's only subview and it worked fine. UIImageView has userInteractionEnabled set to NO by default.

I also had another UIControl with a UIView as it's top most subview (technically the same UIControl in a different state). I believe UIView defaults to userInteractionEnabled == YES, which precluded the events being handled by the UIControl. Settings the UIView's userInteractionEnabled to NO solved my issue.

I don't know if it's the same issue here, but maybe that will help?

-- Edit: When I say topmost view... probably set all subviews of the UIControl to setUserInteractionEnabled:NO