jxdwinter
jxdwinter

Reputation: 2369

UITextField change placeholder color when it become first Responder

Is there any way to change the first responder UITextField's placeholder color? Thanks a lot!

Upvotes: 0

Views: 306

Answers (1)

Ruchika Gupta
Ruchika Gupta

Reputation: 96

You can change the UITextField placeholder color on first responder event as like in its delegate method

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
     [textField setValue:[UIColor yellowColor] forKeyPath:@"_placeholderLabel.textColor"];
    return YES;
}

Upvotes: 1

Related Questions