iOS

xcode 11 与 ios 13更新内容

2019-09-26  本文已影响0人  DkJone
  1. xcode 11 删除application loader,如果需要使用可以从之前版本的xcode中提取路径是/⁨application/⁨Xcode⁩/⁨Contents⁩

  2. 在xcode 11中 UIViewControllermodalPresentationStyle默认不再是全屏,所以当我们present视图时,顶部会缺少一块,想要改成全屏需要设置

vc.modalPresentationStyle = .fullScreen
  1. 在xcode 11 present出带透明背景的视图不显示问题
    // in xcode 10
        let navc = NavigationController(rootViewController: vc)
        navc.modalPresentationStyle = .overCurrentContext
        navc.view.backgroundColor = .clear
        navc.navigationBar.isHidden = true
        self.present(navc, animated: true, completion: nil)
    // in xocde 11
    
            let navc = NavigationController(rootViewController: vc)
        navc.modalPresentationStyle = .overFullScreen
        navc.view.backgroundColor = .clear
        navc.navigationBar.isHidden = true
        inVC.present(navc, animated: true, completion: nil)

4.xcode 11 新建项目及配置

在xcode11中新建项目默认使用ios13 SDK创建,会直接将APP生命周期从APPdelegate转交给SceneDelegate
项目文件结构如下

├── yourProject                                  // 项目文件
│   ├── yourProject                             // 源码文件夹
│   │   ├── AppDelegate.swift           
│   │   ├── SceneDelegate.swift             
│   │   ├── ViewController.swift                    
│   │   ├── Main.storyboard                
│   │   ├── Assets.xcassets                     
│   │   │   └── shop.png                   
│   │   ├── LaunchScreen.storyboard                        
│   │   ├── Info.plist                

如果我们修改development target 低于13.0 编译项目就会报错,是由于新api(sceneDelegate)导致的,为此我们需要将生命周期还原为APPdelegate来管理,

p2.png

编译后运行即可

未完待续。。。

上一篇下一篇

猜你喜欢

热点阅读