iOS 13 - 以编程方式在全屏模式下转至新故事板 nv/vc

iOS 13 - Segue modally to a new storyboard nv/vc in full screen programmatically

随着新的 iOS 13 升级,我的应用程序现在不会全屏显示模态转场。我该如何解决这个问题?

    let viewController:UIViewController = UIStoryboard(name: "Admin", bundle: nil).instantiateViewController(withIdentifier: "AdminNav") as UIViewController
    self.present(viewController, animated: true, completion: nil) 

您需要将 modalPresentationStyle 设置为 .fullScreen:

let viewController = UIStoryboard(name: "Admin", bundle: nil).instantiateViewController(withIdentifier: "AdminNav")
viewController.modalPresentationStyle = .fullScreen
present(viewController, animated: true, completion: nil)