From 5adf71d38bbeaddbc9a6a629d61261efe0691291 Mon Sep 17 00:00:00 2001 From: Brian Nickel Date: Sun, 8 Sep 2013 21:14:30 -0700 Subject: [PATCH] Apply dismissPopover fix from master. Resolves issue #237. --- Classes/KIFUITestActor.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/KIFUITestActor.m b/Classes/KIFUITestActor.m index 091b1a9dc..ca45166f1 100644 --- a/Classes/KIFUITestActor.m +++ b/Classes/KIFUITestActor.m @@ -423,11 +423,11 @@ - (void)setValue:(float)value forSliderWithAccessibilityLabel:(NSString *)label - (void)dismissPopover { const NSTimeInterval tapDelay = 0.05; - NSArray *windows = [[UIApplication sharedApplication] windowsWithKeyWindow]; - if (!windows.count) { - [self failWithError:[NSError KIFErrorWithFormat:@"Failed to find any windows in the application"] stopTest:YES]; + UIWindow *window = [[UIApplication sharedApplication] dimmingViewWindow]; + if (!window) { + [self failWithError:[NSError KIFErrorWithFormat:@"Failed to find any dimming views in the application"] stopTest:YES]; } - UIView *dimmingView = [[windows[0] subviewsWithClassNamePrefix:@"UIDimmingView"] lastObject]; + UIView *dimmingView = [[window subviewsWithClassNamePrefix:@"UIDimmingView"] lastObject]; [dimmingView tapAtPoint:CGPointMake(50.0f, 50.0f)]; CFRunLoopRunInMode(kCFRunLoopDefaultMode, tapDelay, false); }