Guest User

Untitled

a guest
Dec 9th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. class IndentedLabel: UILabel {
  2. override func drawText(in rect: CGRect) {
  3. let insets = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 0)
  4.  
  5. // let customRect = UIEdgeInsetsInsetRect(rect, insets) Swift 4.0
  6.  
  7. // Swift 4.2~
  8. let customRect = rect.inset(by: insets)
  9. super.drawText(in: customRect)
  10. }
  11. }
Add Comment
Please, Sign In to add comment