In our previous chapters on Interface Builder and creating controllers and view objects, you learned about subclassing. To reiterate, subclassing is a way of inheriting and extending a class to add new functionality. In iOS, every object that appears on the screen is a subclass of a base
UIView class (in OS X, the base class is
NSView). We subclass
UIView because this class has all of the basic functionality that we need in order to show something on the screen and allow user interaction.
Any Custom Control that you create will need to subclass
UIView as well.
To begin, let's create our example Xcode project. Go to
Project and create a new Single View Application in Xcode, cab be called as CustomControlsExample ...