iOS 5.0에서 추가된 notification 중에 UIKeyboardDidChangeFrameNotification 가 생겼다.

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardChanged:) name:UITextFieldTextDidChangeNotification object:nil];


// 이건 그냥 써보기 ㅋ
[[
NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardChanged:) name:UIKeyboardDidChangeFrameNotification object:nil];
 



Results :

2012-01-03 16:27:47.909 Empty[4705:10403] NSConcreteNotification 0x6eb69d0 {name = UIKeyboardDidChangeFrameNotification; userInfo = {

    UIKeyboardAnimationCurveUserInfoKey = 0;

    UIKeyboardAnimationDurationUserInfoKey = "0.25";

    UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";

    UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 588}";

    UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 372}";

    UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 480}, {320, 216}}";

    UIKeyboardFrameChangedByUserInteraction = 0;

    UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 264}, {320, 216}}";

}}
// userInfo 가지고 노닥노닥 하면 프레임이 바뀔때마다 재조정하기 편하지 않을까??

 

2012-01-03 16:29:08.342 Empty[4705:10403] NSConcreteNotification 0x6ed0750 {name = UITextFieldTextDidChangeNotification; object = <UITextField: 0x6ea8e50; frame = (0 100; 320 40); text = ''; clipsToBounds = YES; opaque = NO; layer = <CALayer: 0x6ea8c50>>} 
// 텍스트필드에 입력되는 모든 글자가 text로 전달되어 온다.
// 마지막 키값은 따로 입력돼서 꼼수로 해결했었는데 이거면 해결할 수 있겠다 ㅎ 

+ Recent posts