PlaceholderLabel
PlaceholderLabel copied to clipboard
UILabel with placeholder support
PlaceholderLabel
Gives UILabel options to set a placeholder text and placeholder text color.
Installation
PlaceholderLabel is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'PlaceholderLabel'
Example
You can set the placeholder text and placeholder text color from the Storyboard or you can also do the following:
@IBOutlet weak var nameLabel: PlaceholderLabel!
@IBOutlet weak var genderLabel: PlaceholderLabel!
@IBOutlet weak var birthdayLabel: PlaceholderLabel!
override func viewDidLoad() {
super.viewDidLoad()
nameLabel.text = "Eric"
genderLabel.text = "Male"
birthdayLabel.placeholder = "n/a"
birthdayLabel.placeholderColor = .gray
}
License
PlaceholderLabel is available under the MIT license. See the LICENSE file for more info.