0

I used to change the view controller using the following process:

let home = MainController.init(nibName: nil, bundle: nil)
self.present(home, animated: true, completion: nil)

But after the recent update of iOS I am getting something like this :

Screenshot

I have tried other way but its not working. How should I change the root view controller so that this won't be visible. Any idea or code snippet will be at great help! Thanks in advance

Piyush
  • 492
  • 5
  • 22
  • Possible duplicate of [Presenting modal in iOS 13 fullscreen](https://stackoverflow.com/questions/56435510/presenting-modal-in-ios-13-fullscreen) – TylerP Dec 10 '19 at 06:30

1 Answers1

0

You need to enable isModalInPresentation property of the view controller.

//it will prevent the interactive dismissal of the presented view controller on iOS 13 and later
home.isModalInPresentation = true 

From Apple Doc:

modalInPresentation is set on the view controller when you wish to force the presentation hosting the view controller into modal behavior. When this is active, the presentation will prevent interactive dismiss and ignore events outside of the presented view controller's bounds until this is set to NO.

Or you can set this property of view controller.

home.modalPresentationStyle = .fullScreen. //use .overFullScreen for transparency
Mahendra
  • 8,448
  • 3
  • 33
  • 56