The situation arises when my iPhone/iPad is to be connected to an external display.
In the normal situation, the entire device's screen gets mirrored to the external display. But, I need the screen on the external display to display content that is different from that in the device, for a specific view/page.
I have a UIImageView inside a UIScrollView, and some related buttons (next, previous, etc) as part of a specific View Controller of the app. I want the external device to display only the content in the UIScrollView (that is, the buttons are not to be shown). For this, it seems like I have to create another instance of UIWindow for the external display screen.
But, how can I make the UIWindow (and it's content) in the external display to respond correspondingly to the changes made to the main UIWindow (the one which is displayed in the iPhone/iPad). That is, changes like zooming in and zooming out.
You can do somthing like this:
Now all you need to do is create the
ExternalScreenViewController
with a UIView that fills the entire viewController. Finally you just set the view of the target equal to the view of the scrollView.