File tree 2 files changed +15
-16
lines changed
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;
134
134
135
135
- (NSArray *)windowsWithKeyWindow
136
136
{
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
+ }
141
143
}
144
+
142
145
return windows;
143
146
}
144
147
145
148
- (UIWindow *)windowSceneKeyWindow
146
149
{
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;
154
153
}
155
154
}
156
155
@@ -168,7 +167,7 @@ - (float)animationSpeed
168
167
169
168
- (void )setAnimationSpeed : (float )animationSpeed
170
169
{
171
- for (UIWindow *window in self. windows ) {
170
+ for (UIWindow *window in [ self windowsWithKeyWindow ] ) {
172
171
window.layer .speed = animationSpeed;
173
172
}
174
173
}
Original file line number Diff line number Diff line change 1
1
#import " KIFTouchVisualizerViewCoordinator.h"
2
2
#import " KIFTouchVisualizerView.h"
3
- #import " UIApplication-KifAdditions .h"
3
+ #import " UIApplication-KIFAdditions .h"
4
4
5
5
static const CGFloat KIFTouchAnimationDuration = 0.75 ;
6
6
@@ -57,10 +57,10 @@ - (void)touchEnded:(nonnull UITouch *)touch
57
57
58
58
- (UIWindow *)_topWindow
59
59
{
60
- UIWindow *topWindow = [UIApplication.sharedApplication windowSceneKeyWindow ];
60
+ NSMutableArray *windows = [[UIApplication.sharedApplication windowsWithKeyWindow ] mutableCopy ];
61
+ UIWindow *topWindow = windows.firstObject ;
61
62
62
- for (UIWindow *window in UIApplication.sharedApplication .windows ) {
63
- topWindow = window;
63
+ for (UIWindow *window in windows) {
64
64
if (!window.isHidden && window.windowLevel > topWindow.windowLevel ) {
65
65
topWindow = window;
66
66
}
You can’t perform that action at this time.
0 commit comments