AirPlay mirroring is what you are looking for. AirPlay can operate in two modes:
- the entire screen is mirrored to the AirPlay device
- there are two
UIWindow
/UIScreen
's to work with, and one of them is mirrored.
Since the view you want to mirror is not fullscreen. You have to go for second option.
Unfortunately, there is no technical way to have a single instance of a UIView
show on both of the windows.
Option 1 - Twin views
If you want the same thing to show on both screens, you need to create two instances of the same UIView
, and add them respectively to the two windows, and then update both of them as they change.
Option 2 - UISnapshotting
Another option is to setup a timer and update the contents of the window you want to present a couple of times per second. With iOS 7 Apple introduced UISnapshotting
and they claim it's really fast, much faster than renderInContext:
. I haven't researched if its performance is high enough to call it many times per second but it should work.
UIView *snapshot = [view snapshotViewAfterScreenUpdates:YES];
This method captures the current visual contents of the screen from
the render server and uses them to build a new snapshot view. You can
use the returned snapshot view as a visual stand-in for the screen’s
contents in your app. (...) this method is faster than trying to
render the contents of the screen into a bitmap image yourself.
Moreover, have a look into links below. They should give you some insights and point to the right direction.