Created
July 10, 2020 08:44
-
-
Save abhimuralidharan/52f8e1418f3a4433c4f0eb8792e18689 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
class CustomLabel: UILabel { | |
let edgeInsets: UIEdgeInsets | |
init(frame: CGRect, insets: UIEdgeInsets) { | |
edgeInsets = insets | |
super.init(frame: frame) | |
} | |
convenience init(text: String?, dx: CGFloat, dy: CGFloat) { | |
let insets = UIEdgeInsets(top: dy, left: dx, bottom: dy, right: dx) | |
self.init(frame: .zero, insets: insets) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment