-
-
Save gliubc/91fade43359a38797ca275efb25706a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ([textField respondsToSelector:@selector(setAttributedPlaceholder:)]) { | |
UIColor *color = [UIColor blackColor]; | |
textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:placeholderText attributes:@{NSForegroundColorAttributeName: color}]; | |
} else { | |
NSLog(@"Cannot set placeholder text's color, because deployment target is earlier than iOS 6.0"); | |
// TODO: Add fall-back code to set placeholder color. | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment