xcode 11 与 ios 13更新内容

  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来管理,

  • 打开info.plis删除Application Scene Manifest这一项
  • 删除 SceneDelegate.swift 文件
  • 将APPdelegate进行如下修改
p2.png

编译后运行即可

未完待续。。。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Swift1> Swift和OC的区别1.1> Swift没有地址/指针的概念1.2> 泛型1.3> 类型严谨 对...
    cosWriter阅读 11,171评论 1 32
  • iOS 13 支持适配的机型 iPhone X、iPhone XR、iPhone XS、iPhone XS Max...
    不成活不疯魔阅读 44,264评论 22 131
  • 外在命运和内在想象是镜像关系,改变外在命运需要去认识、去改变内在意识。 人的任何选择是为了追求好处(利益),内在的...
    绿树荫浓阅读 250评论 0 0
  • NSUserDefaults * settings = [NSUserDefaults standardUserD...
    蜗牛也有梦想阅读 120评论 0 0
  • 我真是个奇怪的人,那深藏于心的叛逆,总让我做出一些很傻的事,但是真的,控制不住自己。 不知道会不会...
    _出云阅读 106评论 0 1