Subclassing UIView in Swift
Here are Apple’s Subclassing notes from their documentation:
UIViewclass is a key subclassing point for visual content that also requires user interactions. Although there are many good reasons to subclass
UIView, it is recommended that you do so only when the basic
UIViewclass or the standard system views do not provide the capabilities that you need. Subclassing requires more work on your part to implement the view and to tune its performance.