Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes case when font is different from attributed font. #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

popwarfour
Copy link

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
Copy link
Author

popwarfour commented Jan 4, 2018

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?

@devxoul
Copy link
Owner

devxoul commented Jan 5, 2018

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;
 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants