File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
IdentityCore/src/util/ios Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -36,20 +36,17 @@ + (UIViewController *)msidCurrentViewController:(UIViewController *)parentContro
3636
3737 if ([MSIDAppExtensionUtil isExecutingInAppExtension ]) return nil ;
3838
39- NSArray <UIScene *> *scenes; NSArray <UIWindow *> *windows;
40-
41- scenes = [[[MSIDAppExtensionUtil sharedApplication ] connectedScenes ] allObjects ];
42-
43- if (scenes && scenes.count != 0 )
44- {
45- windows = [(UIWindowScene *)[scenes objectAtIndex: 0 ] windows ];
46- }
47-
48- for (UIWindow *window in windows)
39+ for (UIWindowScene* scene in [[MSIDAppExtensionUtil sharedApplication ] connectedScenes ])
4940 {
50- if (window. isKeyWindow )
41+ if (scene. activationState == UISceneActivationStateForegroundActive )
5142 {
52- return [self msidCurrentViewControllerWithRootViewController: window.rootViewController];
43+ for (UIWindow *window in scene.windows )
44+ {
45+ if (window.isKeyWindow )
46+ {
47+ return [self msidCurrentViewControllerWithRootViewController: window.rootViewController];
48+ }
49+ }
5350 }
5451 }
5552
You can’t perform that action at this time.
0 commit comments