Created
February 21, 2019 05:28
-
-
Save quocnb/e17bb369da503f6b6ec58fedae358a56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class MarginLabel: UILabel { | |
var insets = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5) | |
override func drawText(in rect: CGRect) { | |
super.drawText(in: rect.inset(by: insets)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment