Search code examples
xcodeios13swift5

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


With the new iOS 13 upgrade, my app now doesn't display my modally segues in full screen. How do I resolve this issue?

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

Solution

  • You need to set modalPresentationStyle to .fullScreen:

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