fix problem with containers views & attribution iteration
Showing
1 changed file
with
6 additions
and
9 deletions
@@ -487,19 +487,16 @@ | @@ -487,19 +487,16 @@ | ||
487 | { | 487 | { |
488 | if ( ! self.viewControllerPresentingAttribution && ! _hideAttribution) | 488 | if ( ! self.viewControllerPresentingAttribution && ! _hideAttribution) |
489 | { | 489 | { |
490 | - UIViewController *candidateViewController = self.window.rootViewController; | 490 | + UIResponder *responder = self; |
491 | 491 | ||
492 | - while ([self isDescendantOfView:candidateViewController.view]) | 492 | + while ((responder = [responder nextResponder])) |
493 | { | 493 | { |
494 | - for (UIViewController *childViewController in candidateViewController.childViewControllers) | ||
495 | - if ([self isDescendantOfView:childViewController.view]) | ||
496 | - candidateViewController = childViewController; | ||
497 | - | ||
498 | - if ( ! [candidateViewController.childViewControllers count] || [candidateViewController isEqual:self.window.rootViewController]) | 494 | + if ([responder isKindOfClass:[UIViewController class]]) |
495 | + { | ||
496 | + self.viewControllerPresentingAttribution = (UIViewController *)responder; | ||
499 | break; | 497 | break; |
498 | + } | ||
500 | } | 499 | } |
501 | - | ||
502 | - self.viewControllerPresentingAttribution = candidateViewController; | ||
503 | } | 500 | } |
504 | else if (self.viewControllerPresentingAttribution && _hideAttribution) | 501 | else if (self.viewControllerPresentingAttribution && _hideAttribution) |
505 | { | 502 | { |
-
Please register or login to post a comment