1

I have two view controllers, first view controller and the second view controller, when the user segue from the first view controller to the second view controller, the first view controller still visible and sits behind the second view controller. The user can swipe the first view controller and see the entire first view controller and then they got stuck there. I noticed that this only happens after the launch of iOS 13.

performSegue(withIdentifier: "showSecond", sender: self)

enter image description here

JIANG
  • 1,687
  • 2
  • 19
  • 36
  • [View Controller Presentation Changes in iOS 13](https://medium.com/@hacknicity/view-controller-presentation-changes-in-ios-13-ac8c901ebc4e), [5 breaking changes to check before building your app for iOS 13](https://fluffy.es/4-ios13-breaking-changes/), [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen) – MadProgrammer Feb 20 '20 at 21:49
  • You are absolutely right. I noticed this only happened after the launch of the iOS 13. – JIANG Feb 20 '20 at 22:36

3 Answers3

2

Follow these two steps:

  1. Click on the segue you created on the Storyboard
  2. Go to Attributes Inspector
  3. Set the Presentation to "Full Screen"

enter image description here

Maysam
  • 7,246
  • 13
  • 68
  • 106
1

@Maysam is 100% right! But you can also do it programmatically through this:

  // Go to next View Controller
@IBAction func nextTextVC(_ sender: UIButton) {

    let storyboard = UIStoryboard(name: "Main", bundle: nil)
    let nextInfo = storyboard.instantiateViewController(identifier: "socialOptionsIntroViewController")
    self.navigationController?.pushViewController(nextInfo, animated: true)
        }
Kasey
  • 374
  • 2
  • 12
0

There is a more detail thread could answer this question.

The follow solution from Pratik Sodha

let controller = UIViewController()
let navigationController = UINavigationController(rootViewController: controller)
navigationController.modalPresentationStyle = .overCurrentContext
self.navigationController?.present(navigationController, animated: true, completion: nil)
JIANG
  • 1,687
  • 2
  • 19
  • 36