Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

Placeholder Color is Black When Used in Storyboard #14

Closed
sethfri opened this issue Jan 9, 2014 · 4 comments
Closed

Placeholder Color is Black When Used in Storyboard #14

sethfri opened this issue Jan 9, 2014 · 4 comments

Comments

@sethfri
Copy link

sethfri commented Jan 9, 2014

Since Version 0.2.0 and the introduction of attributedPlaceholder, when the default SAMTextView is placed into a storyboard and something like

textView.placeholder = @"Example";

is done in code, the color of the placeholder text, which used to be light gray by default, is ignored. Whatever color the actual text is set to be in the storyboard is the color set for the placeholder text as well.

I'm doubting this is intentional behavior, but I just wanted to run it by you and make sure.

@ScottPetit
Copy link

I think the is probably due to the textView being the first responder prior to you setting the placeholder text. Because of this line here

if ([self isFirstResponder] && self.typingAttributes) {
                [attributes addEntriesFromDictionary:self.typingAttributes];
        }

sets the attributes to the typing attributes of the textView. It's easy enough to remove that if but I'm not quite sure what the intentional behavior is.

@sethfri
Copy link
Author

sethfri commented Jan 29, 2014

@ScottPetit Actually I just realized the [self isFirstResponder] check was added after 0.2.0 and fixes the issue I've described.

@soffes Could you make a tag for Version 0.2.1 so people utilizing CocoaPods can take advantage of this fix?

@soffes
Copy link
Owner

soffes commented Feb 19, 2014

Done!

@soffes soffes closed this as completed Feb 19, 2014
@sethfri
Copy link
Author

sethfri commented Feb 20, 2014

Thanks Sam!

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

No branches or pull requests

3 participants