method one:
_codeTextField . attributedPlaceholder = [[ NSAttributedString alloc ] initWithString : @" Please enter the verification code (4 digits )" attributes : @{ NSForegroundColorAttributeName :[ UIColor colorWithHex : kTextLightGray ] } ];
Method 2: KVC method
_phoneTextField . placeholder = @" Please enter the phone number " ;
[_phoneTextFieldsetValue:[UIColorcolorWithHex:kTextLightGray] forKeyPath:@"_placeholderLabel.textColor"];
_phoneTextField . placeholder = @" Please enter the phone number " ;
This sentence needs to be placed in front of the set color. . . . . . . . . . Otherwise it doesn't work. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!