/UILabel-YHPlaceholder

A missing placeholder for UILabel.

Primary LanguageObjective-CMIT LicenseMIT

UILabel+YHPlaceholder

A missing placeholder for UILabel.

Installation

Use CocoaPods.

pod 'UILabel+YHPlaceholder'

Usage

#import "UILabel+YHPlaceholder.h"

Then create UILabel and set placeholder.

  • Implement Objective-C:
UILabel *label = [[UILabel alloc] init];
label.placeholder = @"How are you?";
label.placeholderColor = UIColor.lightGrayColor; // optional
label.attributedPlaceholder = ... // NSAttributedString (optional)
  • Storyboard:

Alt text

License

UILabel+YHPlaceholder is under MIT license. See the LICENSE file for more information.