1、[self.textField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];奔溃
解决方案:
if (@available(iOS 13.0, *)) {
self.textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入" attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor whiteColor]}];
}
else {
[self.textField setValue:[UIColor whiteColor] forKeyPath:@"_placeholderLabel.textColor"];
}
2、在iOS13中presentViewController和之前弹出的样式不一样
会出现这种情况是主要是因为我们之前对UIViewController里面的一个属性,即modalPresentationStyle(该属性是控制器在模态视图时将要使用的样式)没有设置需要的类型。在iOS13中modalPresentationStyle的默认改为UIModalPresentationAutomatic,而在之前默认是UIModalPresentationFullScreen。
参考https://www.cnblogs.com/guoshaobin/p/11167191.html
if (@available(iOS 13.0, *)) {
nav.modalPresentationStyle = UIModalPresentationFullScreen;
}
else {
}