0

I'm using Xcode 11 since a few days. From the startup screen you can press a button to go to the next screen via a show-segue. In this second screen you can swipe down. This results in returning to the startup screen. However I expected that this behavior is only possible for modal screens, using the Present Modally segue.

I tried the different segue kinds (Show, Show Detail, Present Modally, Present as Popover), but they all result in that the second screen can be swiped down. I tried to use isModalInPresentation = true, but this the user can still pull down the window (however it does not get dismissed).

I expect that the second screen is as the startup screen which cannot be dismissed by pulling it down, nor give the feeling it is a modal dialog (which it isn't to begin with).

Show segue with navigation controller

  • where did you specify `isModalInPresentation = true`? – Suh Fangmbeng Oct 06 '19 at 08:13
  • I placed the isModalInPresentation = true in the second view controller. It doesn't dismiss the view but still you can drag it down a bit, and then it shows a bit of the startup view controlle (main menu screen), after the second VC pops back up. What I want is that it is not possible to drag down the screen, also not for a bit. – Johan van den Berg Oct 06 '19 at 08:28
  • I updated my answer, hope it helps you and saves you more time – Suh Fangmbeng Oct 06 '19 at 08:42

1 Answers1

0

isModalInPresentation = true has to work if you specify it in the second view controller which you have presented.

For example: if you are presenting HomeViewController, make sure in the viewDidLoad() of HomeViewController, you have a line of code that says isModalInPresentation = true.

If you still wish to stop the little bouncing down behavior of the second view controller, unfortunately you have to create your own custom presentation style similar to that to achieve what you want. It's not yet possible from the Apple docs at the moment.

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Suh Fangmbeng
  • 573
  • 4
  • 16