This repository was archived by the owner on Oct 30, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ UIKIT_EXTERN NSString * const SLKTextViewPastedItemData;
5050/* * The placeholder's number of lines. Default is 1. */
5151@property (nonatomic , readwrite ) NSInteger placeholderNumberOfLines;
5252
53+ /* * The placeholder's font. Default is the textView's font. */
54+ @property (nonatomic , copy , null_resettable) UIFont *placeholderFont;
55+
5356/* * The maximum number of lines before enabling scrolling. Default is 0 wich means limitless.
5457 If dynamic type is enabled, the maximum number of lines will be calculated proportionally to the user preferred font size. */
5558@property (nonatomic , readwrite ) NSUInteger maxNumberOfLines;
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ - (UIColor *)placeholderColor
160160 return self.placeholderLabel .textColor ;
161161}
162162
163+ - (UIFont *)placeholderFont
164+ {
165+ return self.placeholderLabel .font ;
166+ }
167+
163168- (NSUInteger )numberOfLines
164169{
165170 CGSize contentSize = self.contentSize ;
@@ -408,6 +413,16 @@ - (void)setPlaceholderNumberOfLines:(NSInteger)numberOfLines
408413 [self setNeedsLayout ];
409414}
410415
416+ - (void )setPlaceholderFont : (UIFont *)placeholderFont
417+ {
418+ if (!placeholderFont) {
419+ self.placeholderLabel .font = self.font ;
420+ }
421+ else {
422+ self.placeholderLabel .font = placeholderFont;
423+ }
424+ }
425+
411426- (void )setUndoManagerEnabled : (BOOL )enabled
412427{
413428 if (self.undoManagerEnabled == enabled) {
You can’t perform that action at this time.
0 commit comments