Last active
June 17, 2018 13:05
-
-
Save boherna/33002692c103c3a1ab58 to your computer and use it in GitHub Desktop.
To find the window containing the keyboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (UIWindow *)findKeyboardWindow | |
{ | |
UIWindow *keyboardWindow = nil; | |
for (UIWindow *window in [[UIApplication sharedApplication] windows]) | |
{ | |
if ([NSStringFromClass([window class]) isEqualToString:@"UITextEffectsWindow"]) | |
{ | |
keyboardWindow = window; | |
break; | |
} | |
} | |
return keyboardWindow; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment