Search code examples
iosuiviewcontrollerswift4xcode10

Is it possible to have 2 view controllers from 2 different storyboards to be active on the screen simultaneously?


I am trying to develop something on the lines of the Uber app. I have to keep the 2 view controllers in separate storyboards. I need to pull up a drawer like in Uber over a View controller which has a scnview. In simpler term and taking Uber as an example, I need a way to accomplish the same interaction where the mapViewController is in one storyboard and the drawer having the driver details to be in another storyboard.


Solution

  • You can implement this feature in many other ways as well,

    But answer to your question is - Yes you can display more than one controller at the same time on screen.

    You can use ContainerView like this :

    enter image description here

    And using Storyboard reference, you can contain UIViewController of another storyboard's controller.