One good idea is to create one file to access this class from anywhere. Here is the code:
UIKeyboard.h
#importUIKeyboard.m
#import "UIKeyboard.h"@implementation UIApplication (KeyboardView)- (UIView *)keyboardView{ NSArray *windows = [self windows]; for (UIWindow *window in [windows reverseObjectEnumerator]) { for (UIView *view in [window subviews]) { if (!strcmp(object_getClassName(view), "UIKeyboard")) { return view; } } } return nil;}@endNow you can import and access this class from your own class:
#import "UIKeyboard.h" // Keyboard Instance Pointer. UIView *keyboardView = [[UIApplication sharedApplication] keyboardView];A full documentation of this class you can find here: http://ericasadun.com/iPhoneDocs/_u_i_keyboard_8h-source.html
More information you can find here: http://cocoawithlove.com/2009/04/showing-message-over-iphone-keyboard.html
ليست هناك تعليقات:
إرسال تعليق