Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for [[UIApplication sharedApplication] keyWindow] returning nil #152

Merged
merged 1 commit into from

5 participants

@mflint

[[UIApplication sharedApplication] keyWindow] has been observed to return nil. This fixes that by getting UIWindow via the application delegate.

@mflint

This was causing accessibility-detection to fail.

@iotize

This works great! Thanks for the fix.

@gfontenot

Is this going to be merged into master at any point?

@paularmstrong

Just stumbled across this issue as well. 2 Months old!?

@mflint
@puls puls merged commit 16f513c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Classes/KIFTestController.m
View
2  Classes/KIFTestController.m
@@ -274,7 +274,7 @@ - (BOOL)_isAccessibilityInspectorEnabled;
{
// This method for testing if the inspector is enabled was taken from the Frank framework.
// https://github.com/moredip/Frank
- UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
+ UIWindow *keyWindow = [[[UIApplication sharedApplication] delegate] window];
NSString *originalAccessibilityLabel = [keyWindow accessibilityLabel];
[keyWindow setAccessibilityLabel:@"KIF Test Label"];
Something went wrong with that request. Please try again.