At the very base, all visual elements are derived from the UIView
object described in UIKit
. A custom control is basically a custom class that is derived from a UIView
class and is responsible for displaying itself visually on the screen.
Some controls such as the stock ticker will display the data based on the stocks that you might want to track. In the case of a progress bar, however, you might want to set the progress and then also retrieve the progress status at some point.
First, let us start with the basics; we will create a class and give it some properties. Since this is a visual class, we will need to derive it from UIView
. Perform the following steps:
Start a new project and name it
customControl1
:Click on
Main.storyboard
to open it in the editor and then drag a view control onto the View Controller scene. This will be the placeholder for our custom control. Since the view has a white background and so does our scene, it is a little difficult to see white...