xcode 11 刪除application loader,如果需要使用可以從之前版本的xcode中提取路徑是
/application/Xcode/Contents
在xcode 11中
UIViewController
的modalPresentationStyle
默認不再是全屏,所以當我們present
視圖時,頂部會缺少一塊,想要改成全屏需要設置
vc.modalPresentationStyle = .fullScreen
- 在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進行如下修改
編譯後運行即可
未完待續。。。