From d3227649875f4ff43d71e37603cbc81fe4545297 Mon Sep 17 00:00:00 2001 From: Kyle Matthew Hedden Date: Fri, 7 Aug 2020 11:35:15 -0400 Subject: [PATCH] code review enhancement --- MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m index a00603da..ad9f5e3d 100644 --- a/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m +++ b/MVMCoreUI/TopAlert/MVMCoreUITopAlertExpandableView.m @@ -414,14 +414,7 @@ if (![focusedElement isKindOfClass:[UIView class]]) { return NO; } - UIView *focusedView = focusedElement; - while (focusedView != nil) { - if (focusedView == self) { - return YES; - } - focusedView = [focusedView superview]; - } - return NO; + return [(UIView *)focusedElement isDescendantOfView:self]; } - (void)accessibilityFocusChanged:(NSNotification *)notification {