Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


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

merged 1 commit into from

5 participants


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


This was causing accessibility-detection to fail.


This works great! Thanks for the fix.


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


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

@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
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.
- 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.