Skip to content

Instantly share code, notes, and snippets.

@boherna
Last active June 17, 2018 13:05
Show Gist options
  • Save boherna/33002692c103c3a1ab58 to your computer and use it in GitHub Desktop.
Save boherna/33002692c103c3a1ab58 to your computer and use it in GitHub Desktop.
To find the window containing the keyboard.
- (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