File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
IdentityCore/src/util/ios Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -36,17 +36,20 @@ + (UIViewController *)msidCurrentViewController:(UIViewController *)parentContro
3636
3737 if ([MSIDAppExtensionUtil isExecutingInAppExtension ]) return nil ;
3838
39- for (UIWindowScene* scene in [[MSIDAppExtensionUtil sharedApplication ] connectedScenes ])
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)
4049 {
41- if (scene. activationState == UISceneActivationStateForegroundActive )
50+ if (window. isKeyWindow )
4251 {
43- for (UIWindow *window in scene.windows )
44- {
45- if (window.isKeyWindow )
46- {
47- return [self msidCurrentViewControllerWithRootViewController: window.rootViewController];
48- }
49- }
52+ return [self msidCurrentViewControllerWithRootViewController: window.rootViewController];
5053 }
5154 }
5255
You can’t perform that action at this time.
0 commit comments