参考:
1、presentViewController
导致不走viewWillDisappear
、viewWillAppear
,是因为iOS13修改了默认的Mode,手动设置模式就好了
ViewController *vc = [[ViewController alloc] init];
vc.title = @"presentVC";
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
[self.window.rootViewController presentViewController:nav animated:YES completion:nil];
2、使用KVC访问或设置私有属性会crash,简单粗暴的处理方式是直接引入AvoidCrash框架就可以很好解决
1. Dark Mode
iOS 13 推出暗黑模式,UIKit
提供新的系统颜色和 api 来适配不同颜色模式,xcassets
对素材适配也做了调整,具体适配可见: Implementing Dark Mode on iOS。
如果不打算适配 Dark Mode,可以直接在 Info.plist
中添加一栏:User Interface Style
: Light
,即可在应用内禁用暗黑模式。不过即使设置了颜色方案,申请权限的系统弹窗还是会依据系统的颜色进行显示,自己创建的 UIAlertController
就不会。