Creating a Custom Control in Swift

Mikael Konutgan of the Ray Wenderlich team recently wrote about creating a custom control in Swift. The completed control will look as follows:

Swift custom control.

If you are looking to build a control that has a basic target-action pattern, read on.

UIControl implements the target-action pattern, which is a mechanism for notifying subscribers of changes. UIControl also has a few properties that relate to control state. You’ll be using the target-action pattern in this custom control, so UIControl will serve as a great starting point.