File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1401,25 +1401,28 @@ - (UIViewController*)contentViewController
14011401
14021402- (UIView *)rootView
14031403{
1404- UIWindow *result = [[UIApplication sharedApplication ] keyWindow ];
1404+ UIWindow *keyWindow = [[UIApplication sharedApplication ] keyWindow ];
14051405
1406- int count = result.subviews .count ;
1406+ int count = keyWindow.subviews .count ;
1407+
1408+ UIView *result = keyWindow;
14071409
14081410 if (count > 0 )
14091411 {
1410- UIView *view = nil ;
1411-
1412- for (NSUInteger i = count ; i < = 0 ; i--)
1412+ int lastIndex = count - 1 ;
1413+
1414+ for (NSInteger i = lastIndex ; i > = 0 ; i--)
14131415 {
1414- view = [result.subviews objectAtIndex: i];
1416+ UIView *view = [keyWindow.subviews objectAtIndex: i];
1417+
1418+ // WY_LOG(@"rootView.subview[%i] = %@", i, view);
14151419
14161420 if (!view.isHidden )
14171421 {
1418- return view;
1422+ result = view;
1423+ break ;
14191424 }
14201425 }
1421-
1422- // result = [result.subviews lastObject];
14231426 }
14241427
14251428 return result;
You can’t perform that action at this time.
0 commit comments