1 // Monitor Keyboard 2 Object : nil]; 3 4 object: nil];
1 #pragmaMark-Keyboard handling2 3 /**4 * Keyboard is about to be hidden5 */6- (void) Keyboardwillhideaction: (Nsnotification *) Note7 {8 9 //1. Time required for keyboard popupTenCGFloat Duration =[Note.userinfo[uikeyboardanimationdurationuserinfokey] doublevalue]; One A //2. Animations -[UIView animatewithduration:duration animations:^{ -Self.view.transform =cgaffinetransformidentity; the }]; - } - - /** + * Keyboard is about to pop up - */ +- (void) Keyboardwillshowaction: (Nsnotification *) Note A { at - //1. Time required for keyboard popup -CGFloat Duration =[Note.userinfo[uikeyboardanimationdurationuserinfokey] doublevalue]; - - //2. Animations -[UIView animatewithduration:duration animations:^{ in //Remove the keyboard height -CGRect KEYBOARDF =[Note.userinfo[uikeyboardframeenduserinfokey] cgrectvalue]; toCGFloat Keyboardh = keyboardF.size.height- +; + if(threeinch) { -Self.view.transform = Cgaffinetransformmaketranslation (0, -Keyboardh); the}Else { *Self.view.transform = Cgaffinetransformmaketranslation (0, - -); $ }Panax Notoginseng }]; -}
iOS keyboard monitor