The UIControl class
There are many different starting points for the creation of your component. If you take a look at some of the custom controls available online, you will find that you can even start from a UIView
subclass and draw the control parts in its drawRect
method. There isn't a "right way to do it", but in order to be consistent with UIKit
controls and have some advantages during the control's implementation, starting with the UIControl
class is definitely a good choice.
This class provides an interface for the common structure of a control. You cannot use it directly, but it has to be subclassed by overriding some main methods if you want to implement your custom functionalities.
The UIControl
class is, in turn, a subclass of UIView
, meaning that you will get all the functions available for the views and your control can be directly attached as a subview of the current user interfaces.
The functionalities provided by the UIControl
class are obviously all about control behaviors...