Before I used:
class IndentedLabel: UILabel {
override func drawText(in rect: CGRect) {
let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
super.drawText(in: rect.inset(by: insets))
}
}
Nice to know it can be in just one line:
super.drawText(in: rect.insetBy(dx: 16, dy: 0)
There isn't ever a day when I will ever finish learning this language.