diff --git a/iOS/Plugins/FlipperKitPluginUtils/FlipperKitLayoutIOSDescriptors/FlipperKitLayoutIOSDescriptors/SKApplicationDescriptor.m b/iOS/Plugins/FlipperKitPluginUtils/FlipperKitLayoutIOSDescriptors/FlipperKitLayoutIOSDescriptors/SKApplicationDescriptor.m index 9bf18af7962..0ab4ef3cd67 100644 --- a/iOS/Plugins/FlipperKitPluginUtils/FlipperKitLayoutIOSDescriptors/FlipperKitLayoutIOSDescriptors/SKApplicationDescriptor.m +++ b/iOS/Plugins/FlipperKitPluginUtils/FlipperKitLayoutIOSDescriptors/FlipperKitLayoutIOSDescriptors/SKApplicationDescriptor.m @@ -57,8 +57,21 @@ - (void)hitTest:(SKTouch*)touch forNode:(UIApplication*)node { } - (NSArray*)visibleChildrenForNode:(UIApplication*)node { + NSMutableArray* windows = [NSMutableArray new]; + if (@available(iOS 13, *)) { + for (UIWindowScene* scene in node.connectedScenes) { + [windows addObjectsFromArray:scene.windows]; + } + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // TODO T202813939 Remove this branch once we drop support for iOS lower + // than 13 + [windows addObjectsFromArray:node.windows]; + } +#pragma clang diagnostic pop NSMutableArray* children = [NSMutableArray new]; - for (UIWindow* window in node.windows) { + for (UIWindow* window in windows) { if ([window isKindOfClass:[SKHiddenWindow class]] || [window isKindOfClass:objc_lookUpClass("FBAccessibilityOverlayWindow")] || diff --git a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDUIApplicationDescriptor.mm b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDUIApplicationDescriptor.mm index afa3507d433..d5edf203626 100644 --- a/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDUIApplicationDescriptor.mm +++ b/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Descriptors/UIDUIApplicationDescriptor.mm @@ -22,8 +22,21 @@ @implementation UIDUIApplicationDescriptor "FBAccessibilityOverlayWindow", "UITextEffectsWindow"}); + NSMutableArray* windows = [NSMutableArray new]; + if (@available(iOS 13, *)) { + for (UIWindowScene* scene in node.connectedScenes) { + [windows addObjectsFromArray:scene.windows]; + } + } else { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // TODO T202813939 Remove this branch once we drop support for iOS lower + // than 13 + [windows addObjectsFromArray:node.windows]; + } +#pragma clang diagnostic pop NSMutableArray* children = [NSMutableArray new]; - for (UIWindow* window in node.windows) { + for (UIWindow* window in windows) { if (ignoredWindows.find(class_getName(window.class)) != ignoredWindows.end()) { continue;