はい、UIWindow のサブクラス化が嫌われていることは知っていますが、サブクラス化された UIWindow はデバッグ目的のみです (特定のモーション イベントが検出されると、現在のページのスクリーンショットが取得されます)。
DEBUGとにかく、プロジェクトのBuild Settingsで呼び出されるカスタム プリコンパイラ フラグを作成しましたが、正しくロード/機能するのに問題があります。現在、スクリーンショットを撮っていませんが、モーション イベントの発生を登録しています。
AppDelegateのコードは次のとおりです didFinishLaunchingWithOptions:
#if DEBUG
DebugWindow *debugWindow = [[DebugWindow alloc] init];
self.window = debugWindow; //'window' is declared in the AppDelegate's @interface file and synthesized as window=_window in the @implementation file
#else
self.window = _window;
#endif
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
