|
@@ -30,9 +30,20 @@
|
30
|
30
|
[overlayWindow setHidden:YES];
|
31
|
31
|
[overlayWindow setRootViewController:nil];
|
32
|
32
|
[overlayWindow resignKeyWindow];
|
|
33
|
+ [self assignKeyWindow];
|
33
|
34
|
[_overlayWindows removeObject:overlayWindow];
|
34
|
35
|
}
|
35
|
36
|
|
|
37
|
+- (void)assignKeyWindow {
|
|
38
|
+ NSArray* windows = [[[UIApplication sharedApplication].windows reverseObjectEnumerator] allObjects];
|
|
39
|
+ for (UIWindow* window in windows) {
|
|
40
|
+ if (window.rootViewController) {
|
|
41
|
+ [window makeKeyAndVisible];
|
|
42
|
+ return;
|
|
43
|
+ }
|
|
44
|
+ }
|
|
45
|
+}
|
|
46
|
+
|
36
|
47
|
- (UIWindow *)findWindowByRootViewController:(UIViewController *)viewController {
|
37
|
48
|
for (UIWindow* window in _overlayWindows) {
|
38
|
49
|
if ([window.rootViewController isEqual:viewController]) {
|