Search code examples
iosswiftxcodeviewcontrollerpresentmodalviewcontroller

View controllers present modally in storyboard, even while turned off


I have a problem in xcode which has been happening for while now, the problem is that even when I turn off the navigation bar in the navigation controller it still presents the view modally in the storyboard. like so: enter image description here

so this fixes it in the simulator, you cant see the present modally or navigation bar, but in the story board it does. this makes it hard to set contraints and is an eye sore to me. the fix for this will be greatly appreciated! following images are 1, the present modally shown in the storyboard and 2, the present modally not showing in the simulator: enter image description here

enter image description here


Solution

  • Well it's an ios 13 thing and the default presentation style for xcode 11 is now automatic(previously current context). Just select the segue of that view controller in storyboard then go to Attributes inspector and you will find the Presentation with automatic as selected, simply change it to Current context and you're good. :)