根據bugly反饋的信息我查看代碼看到:
[self.searchTF setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
這段代碼的意思是設置textField文字的默認顏色。iOS13以後就不能這樣寫了,應該這樣寫:
Ivar ivar = class_getInstanceVariable([UITextField class], "_placeholderLabel");
UILabel *placeholderLabel = object_getIvar(self.searchTF, ivar);
placeholderLabel.textColor = [UIColor whiteColor];