兼容iOS13以及iOS13之前的系统
1.工程配置
新建项目后,选中项目名称,在配置栏中选择Info栏目,在Custom iOS Target Properties子栏目中删除Main storyboard file base name项。
2.在AppDelegate.swift文件中修改
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool 里面设置
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height))
self.window?.backgroundColor = UIColor