Search code examples
iosswiftxcodemenuxcode11

Master Detail Controller is always presented modally since iOS 13


I have a login screen that pushes to a master-detail VC on successful auth.

Master Detail VC presented modally even when segue pushes it into the screen

However the screen following log in is always presented modally, this behavior started since iOS 13 (prior to that, login screen pushed to the initial VC, and another master VC linked VC had the menu)

To demonstrate, I took the final code from RW's master-detail view the tutorial, added a view with a button, linked button's action to master VC with a push segue. After this, even in the storyboard, you can see that the Master VC is presented modally. not pushed.

Attaching source code of modified code which shows what I want to demonstrate this

And a screenshot as well -


Solution

  • From the screen shot you've posted I can see that you don't have a navigation controller embedded to your initial view controller. So when you do a segue from your initial view controller via storyboard it'll present the view controller and presentation will not be fullscreen by default (in iOS 13).

    You can change this setting via storyboard as well as in your view controller

    In storyboard select your view controller and refer to the screenshot

    enter image description here

    For more detail refer to this question for full screen presentation