Created
April 8, 2013 22:19
-
-
Save batosai/5341048 to your computer and use it in GitHub Desktop.
Category for check if keyboard is open.
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
#import <UIKit/UIKit.h> | |
@interface UIWindow (KeyBoard) | |
+ (BOOL)isKeyBoardInDisplay; | |
@end |
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
#import "UIWindow+KeyBoard.h" | |
@implementation UIWindow (KeyBoard) | |
+ (BOOL)isKeyBoardInDisplay { | |
BOOL isExists = NO; | |
for (UIWindow *keyboardWindow in [[UIApplication sharedApplication] windows]) { | |
if ([[keyboardWindow description] hasPrefix:@"<UITextEffectsWindow"] == YES) { | |
isExists = YES; | |
} | |
} | |
return isExists; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment