For the More Curious: UIControl
The class UIControl is the superclass for several classes in Cocoa Touch, including UIButton and UISlider. You have seen how to set the targets and actions for these controls. Now we can take a closer look at how UIControl overrides the same UIResponder methods you implemented in this chapter.
In UIControl, each possible control event is associated with a constant. Buttons, for example, typically send action messages on the UIControlEvents.touchUpInside control event. A target registered for this control event will only receive its action message if the user touches the control and then lifts the finger off the screen inside the frame of the control.
For a button, however, you can have actions ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access