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;
50
50
/* * The placeholder's number of lines. Default is 1. */
51
51
@property (nonatomic , readwrite ) NSInteger placeholderNumberOfLines;
52
52
53
+ /* * The placeholder's font. Default is the textView's font. */
54
+ @property (nonatomic , copy , null_resettable) UIFont *placeholderFont;
55
+
53
56
/* * The maximum number of lines before enabling scrolling. Default is 0 wich means limitless.
54
57
If dynamic type is enabled, the maximum number of lines will be calculated proportionally to the user preferred font size. */
55
58
@property (nonatomic , readwrite ) NSUInteger maxNumberOfLines;
Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ - (UIColor *)placeholderColor
160
160
return self.placeholderLabel .textColor ;
161
161
}
162
162
163
+ - (UIFont *)placeholderFont
164
+ {
165
+ return self.placeholderLabel .font ;
166
+ }
167
+
163
168
- (NSUInteger )numberOfLines
164
169
{
165
170
CGSize contentSize = self.contentSize ;
@@ -408,6 +413,16 @@ - (void)setPlaceholderNumberOfLines:(NSInteger)numberOfLines
408
413
[self setNeedsLayout ];
409
414
}
410
415
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
+
411
426
- (void )setUndoManagerEnabled : (BOOL )enabled
412
427
{
413
428
if (self.undoManagerEnabled == enabled) {
You can’t perform that action at this time.
0 commit comments