Search code examples
iosswiftxcodesegueviewcontroller

When I try to make a button show a different view controller using a segue it adds a black bar at the top


I am using the latest version on Xcode and am trying to connect a button to a new view controller using a segue. In my project I have other buttons that work and the view controller looks normal but when I attach it to this one by control clicking and dragging to another view controller it does this... Image with black space where time and wifi should be

(There is a black space at the top rather than the usual full page)

I have also tried

presentedController.modalPresentationStyle = .fullScreen

However this did not work for some reason. I think a reason that it may not work is because the view controller is disconnected. I need to do this to connect 2 programmatically, how can I fix this?


Solution

  • In your storyboard in segue options choose: Kind: Present Modally Presentation: Fullscreen