/**
第一次点击
UITextFieldTextDidBeginEditingNotification
UIKeyboardWillChangeFrameNotification
UIKeyboardWillShowNotification
第二次点击
UITextFieldTextDidEndEditingNotification
UITextFieldTextDidBeginEditingNotification
消失
UIKeyboardWillChangeFrameNotification
UIKeyboardWillHideNotification
UITextFieldTextDidEndEditingNotification
*/
- (void)textFieldTextDidBeginEditing:(NSNotification *)notification {
[self.stack addObject:notification];
if ([self.stackcount] ==2) {
#warning 键盘未消失,另一文本框获得焦点
[self.stack removeAllObjects];
}
// NSConcreteNotification 0x109642c60 {name = UITextFieldTextDidBeginEditingNotification; object = <CustomTextField: 0x109539f50; baseClass = UITextField; frame = (29 142; 262 40); text = ''; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; tag = 100; gestureRecognizers = <NSArray: 0x10956f260>; layer = <CALayer: 0x10953a370>>}
}
- (void)textFieldTextDidEndEditing:(NSNotification *)notification {
[self.stack addObject:notification];
if ([self.stackcount] ==3) {
#warning 键盘消失
[self.stackremoveAllObjects];
}
// NSConcreteNotification 0x10a879190 {name = UITextFieldTextDidEndEditingNotification; object = <CustomTextField: 0x10a823660; baseClass = UITextField; frame = (29 142; 262 40); text = ''; clipsToBounds = YES; opaque = NO; autoresize = RM+BM; tag = 100; gestureRecognizers = <NSArray: 0x10a858890>; layer = <CALayer: 0x10a823a80>>}
}
- (void)keyboardWillShow:(NSNotification *)notification {
[self.stack addObject:notification];
#warning 键盘抬起
[self.stackremoveAllObjects];
/*
NSConcreteNotification 0x109668120 {name = UIKeyboardWillShowNotification; userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 676}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 216}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
}}
*/
}
- (void)keyboardWillHide:(NSNotification *)notification {
[self.stack addObject:notification];
/*
NSConcreteNotification 0x10a863540 {name = UIKeyboardWillHideNotification; userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 676}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 568}, {320, 216}}";
}}
*/
}
- (void)keyboardWillChangeFrame:(NSNotification *)notification {
[self.stack addObject:notification];
/*
NSConcreteNotification 0x109414690 {name = UIKeyboardWillChangeFrameNotification; userInfo = {
UIKeyboardAnimationCurveUserInfoKey = 7;
UIKeyboardAnimationDurationUserInfoKey = "0.25";
UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";
UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 676}";
UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 460}";
UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 216}}";
UIKeyboardFrameChangedByUserInteraction = 0;
UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 352}, {320, 216}}";
}}
*/
}