iosswiftxcodeviewcontrollerexternal-display

Display a ViewController inside another View Xcode


Okay so I know that you can embed a ViewController inside a view. But the situation I have is a little different

I have an app which is using an external monitor. When the monitor is connected, I'd like to display the ExternalMonitor ViewController inside another view on my iPad screen. Like a Live Preview. I can't work out how to get it to display the ViewController on both my ExternalMonitor and my PreviewView at the same time.

Basically: 1 ViewController displayed in 2 places at the same time, scaled to fit the two different views.

Is this possible. Can someone point me in the right direction?

I apologise if my terminology isn't right. I am quite new to Xcode and swift.


Solution

  • While someone might offer a better solution to this, you might try displaying 2 instances of the same view controller class in 2 different places. It won't work of course, if this controller should respond to user actions. They will not be in sync that way.