Creating Clean Blocks of Code for Custom Views
You want to programmatically create a custom view. Then you want to fill it up with buttons, labels, and all different kinds of subviews. If you aren’t careful, your code can get messy quick. In order to battle this, a popular technique is used by creating everything as stored properties and initializing them as closures. …