UITextView-Placeholder icon indicating copy to clipboard operation
UITextView-Placeholder copied to clipboard

Fixes case when font is different from attributed font.

Open popwarfour opened this issue 7 years ago • 2 comments

Bug There is a bug where a font attributed is ignored (when using attributedPlaceholder). The UITextView's font is used instead.

Fix Checks to see if there is font set on the attributed placeholder. If so we use that. If not we fall back and use the UITextView's font instead.

popwarfour avatar Jan 04 '18 23:01 popwarfour

your unit tests didn't catch it because you needed to check against the placeholderLabel.font instead. I can update those also if you'd like?

popwarfour avatar Jan 04 '18 23:01 popwarfour

Hmm, how about just not updating the font if there is attributedPlaceholder? For example:

 if (self.needsUpdateFont) {
-    self.placeholderLabel.font = self.font;
+    if (self.attributedPlaceholer != nil) {
+        self.placeholderLabel.font = self.font;
+    }
     self.needsUpdateFont = NO;
 }

devxoul avatar Jan 05 '18 11:01 devxoul