We saw how to add UIViews using interface builder or programmatically. These are the most commonly used ways in UIViews while working on an iOS app. In some cases, native components don't fit your needs, and you have to build your own custom UIView. Let's see in action how to build a custom UIView. In the following example, we will see how to build a circular progress bar programmatically and how to use or customize it using interface builder.
Go to Xcode and create a new Swift class CircularProgressBar, which extends UIView. Then, add the following code:
@IBDesignable class CircularProgressBar: UIView { /// The background fixed color of progress bar @IBInspectable var progressFixedColor : UIColor = UIColor.whiteColor() ...