Skip to content

chiahan1123/PlaceholderLabel

Repository files navigation

Build Status Version License Platform

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

screen shot 2017-08-13 at 10 28 24 pm

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.