Created
April 26, 2017 13:47
-
-
Save ConorBrady/fb46c7aa7e7d6b5e37e918c80eaede65 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public extension UILabel { | |
func styleText(font: UIFont, color: UIColor, alignment: NSTextAlignment = .left) -> UILabel { | |
return self <== { | |
$0.font = font | |
$0.textColor = color | |
$0.textAlignment = alignment | |
} | |
} | |
func wrapLines(max: Int = 0) -> UILabel { | |
return self <== { | |
$0.numberOfLines = max | |
$0.lineBreakMode = .byWordWrapping | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment