Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class IndentedLabel: UILabel {
- override func drawText(in rect: CGRect) {
- let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0)
- // let customRect = UIEdgeInsetsInsetRect(rect, insets) Swift 4.0
- // Swift 4.2~
- let customRect = rect.inset(by: insets)
- super.drawText(in: customRect)
- }
- }
Add Comment
Please, Sign In to add comment