TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Apr 2017 |
SwiftSwift Version | 3.1 |
SPMSupports SPM | ✗ |
Maintained by Diego Rincon.
Swift Version | MaskedLabel View Version |
---|---|
3.1 | 0.9.0 |
MaskedLabel is a UILabel subclass that allows you to easily apply a gradient to its text or to make it transparent.
If you prefer not to use either of the aforementioned dependency managers, you can integrate MaskedLabel into your project manually.
MaskedLabel can be used both programmatically and with storyboards.
Add a UILabel to your storyboard and change its class to MaskedLabel.
let maskedLabel = MaskedLabel()
let maskedLabel = MaskedLabel(frame: CGRect(x: 10, y: 50, width: 200, height: 100))
There are a few properties you can set to obtain the desired behavior:
let maskedLabel = MaskedLabel()
maskedLabel.gradientColors = [UIColor.red, UIColor.blue]
maskedLabel.startPoint = CGPoint(x: 0.0, y: 0.0)
maskedLabel.endPoint = CGPoint(x: maskedLabel.frame.width, y: maskedLabel.frame.height)
maskedLabel.fillOption = .background
maskedLabel.text = "MaskedLabel"
ViewControllerStates is released under the MIT license. See license for details.