UITextView-Placeholder
UITextView-Placeholder copied to clipboard
Fixes case when font is different from attributed font.
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.
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?
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;
}