私のアプリケーションでは、セカンダリ ウィンドウを作成し、サブビューを追加して、メイン画面 (iPad) と外部ディスプレイ画面に異なるものを表示します。
私の質問は、固有のコンテンツを表示する必要がなくなった後、デフォルトのアプリ ミラーリングを再度有効にするにはどうすればよいですか? 作成したウィンドウを解放しただけで、画面のmirroredScreenプロパティも設定しようとしましたが、読み取り専用です。
外部モニターに固有のコンテンツを追加するためのコードは次のとおりです。
if ([[UIScreen screens] count] > 1) {
//allocate another window
UIScreen* secondScreen = [[UIScreen screens] objectAtIndex:1];
CGRect screenBounds = secondScreen.bounds;
secondWindow = [[UIWindow alloc] initWithFrame:screenBounds];
secondWindow.screen = secondScreen;
shareViewController.view.hidden = NO;
//add the shareViewController's view to the external display
shareViewController.view.frame = secondWindow.frame;
[secondWindow addSubview:shareViewController.view];
secondWindow.hidden = NO;
}