user12692135
user12692135

Reputation:

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

Upvotes: 1

Views: 1877

Answers (4)

Anand
Anand

Reputation: 1946

In case, if you don't find Presentation under Attributes Inspector of the segue, It can found under View Controller -> Attributes Inspector

Verified in XCode 12.4

Upvotes: 1

Sky Shadow
Sky Shadow

Reputation: 324

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. :)

Upvotes: 0

Pratik Ghadia
Pratik Ghadia

Reputation: 31

Follow this steps to solve your problem:

  1. Select your storyboard segue
  2. Go to "Attributes inspector" (right panel in xcode)
  3. Change value of "Presentation" attribute to "Current Context"

In storyboard you'll found that the presenting layer is removed and the ViewController's View is occupying the whole screen.

Look at the image here, it'll help you out easily and visually.

Upvotes: 2

Paul Schröder
Paul Schröder

Reputation: 1540

Set Presentation to Current Context and the VC will be shown in IB like the NavigationController

Upvotes: 0

Related Questions