IOS 13不可解にフラッシュバックし、プライベートメソッドが呼び出されているかどうかを確認する

526 ワード

このコードはiOS 13でフラッシュバックすることになります.具体的なコードは以下の通りです.
[textField setValue:UIColor.redColor forKeyPath:@"_placeholderLabel.textColor"];
[textField setValue:[UIFont systemFontOfSize:16] forKeyPath:@"_placeholderLabel.font"];
 
ソリューション:
kvcの代わりに次のコードを使用してplaceholderを変更します.textField.attributedPlaceholder = [[NSMutableAttributedString alloc] initWithString:@" " attributes:@{NSFontAttributeName : [UIFont systemFontOfSize:16], NSForegroundColorAttributeName : DescrbeColor}];