File tree Expand file tree Collapse file tree 2 files changed +15
-16
lines changed
Expand file tree Collapse file tree 2 files changed +15
-16
lines changed Original file line number Diff line number Diff line change @@ -134,23 +134,22 @@ - (UIWindow *)getWindowForSubviewClass:(NSString*)className;
134134
135135- (NSArray *)windowsWithKeyWindow
136136{
137- NSMutableArray *windows = self.windows .mutableCopy ;
138- UIWindow *keyWindow = [self windowSceneKeyWindow ];
139- if (keyWindow && ![windows containsObject: keyWindow]) {
140- [windows addObject: keyWindow];
137+ NSMutableArray *windows = [NSMutableArray array ];
138+
139+ for (UIWindowScene *scene in UIApplication.sharedApplication .connectedScenes ) {
140+ if ([scene isKindOfClass: [UIWindowScene class ]]) {
141+ [windows addObjectsFromArray: scene.windows];
142+ }
141143 }
144+
142145 return windows;
143146}
144147
145148- (UIWindow *)windowSceneKeyWindow
146149{
147- for (UIWindowScene *scene in UIApplication.sharedApplication .connectedScenes ) {
148- if ([scene isKindOfClass: [UIWindowScene class ]]) {
149- for (UIWindow *window in [scene.windows reverseObjectEnumerator ]) {
150- if (window.isKeyWindow ) {
151- return window;
152- }
153- }
150+ for (UIWindow *window in [self windowsWithKeyWindow ]) {
151+ if (window.isKeyWindow ) {
152+ return window;
154153 }
155154 }
156155
@@ -168,7 +167,7 @@ - (float)animationSpeed
168167
169168- (void )setAnimationSpeed : (float )animationSpeed
170169{
171- for (UIWindow *window in self. windows ) {
170+ for (UIWindow *window in [ self windowsWithKeyWindow ] ) {
172171 window.layer .speed = animationSpeed;
173172 }
174173}
Original file line number Diff line number Diff line change 11#import " KIFTouchVisualizerViewCoordinator.h"
22#import " KIFTouchVisualizerView.h"
3- #import " UIApplication-KifAdditions .h"
3+ #import " UIApplication-KIFAdditions .h"
44
55static const CGFloat KIFTouchAnimationDuration = 0.75 ;
66
@@ -57,10 +57,10 @@ - (void)touchEnded:(nonnull UITouch *)touch
5757
5858- (UIWindow *)_topWindow
5959{
60- UIWindow *topWindow = [UIApplication.sharedApplication windowSceneKeyWindow ];
60+ NSMutableArray *windows = [[UIApplication.sharedApplication windowsWithKeyWindow ] mutableCopy ];
61+ UIWindow *topWindow = windows.firstObject ;
6162
62- for (UIWindow *window in UIApplication.sharedApplication .windows ) {
63- topWindow = window;
63+ for (UIWindow *window in windows) {
6464 if (!window.isHidden && window.windowLevel > topWindow.windowLevel ) {
6565 topWindow = window;
6666 }
You can’t perform that action at this time.
0 commit comments