适配iOS13

1、presentViewController 默认有视差效果

iOS 13 的 presentViewController 默认有视差效果,模态出来的界面现在默认都下滑返回。 一些页面必须要点确认才能消失的,需要适配。如果项目中页面高度全部是屏幕尺寸,那么多出来的导航高度会出现问题。
如图所示


1FF24E89A084A7007156102D11065A59.jpg
在tabBar里面写
// Swift
self.modalPresentationStyle = .fullScreen

// Objective-C
self.modalPresentationStyle = UIModalPresentationFullScreen;

2、KVC 限制

iOS13 以后已经不能肆无忌惮的通过 KVC 来修改一些没有暴露出来的属性了。
例如:

// UITextField 的 _placeholderLabel
[textField setValue:[UIColor xxx] forKeyPath:@"_placeholderLabel.textColor"];

// UISearchBar 的 _searchField
[searchBar valueForKey:@"_searchField"];

你可能感兴趣的:(适配iOS13)