본문 바로가기
카테고리 없음

Keyboard Notification

by 멍멍돌이야 2011. 3. 30.
반응형
출처: http://meetkei.com/wordpress/?p=1218


● Keyboard Notification
 
// 키보드 통지 등록
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil];

// 키보드 통지 해제
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidShowNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardDidHideNotification object:nil];

// 키보드 통지 처리 메소드
// UIKeyboardWillShowNotification
- (void)keyboardWillShow:(NSNotification *)noti
{

}

// UIKeyboardDidShowNotification
- (void)keyboardDidShow:(NSNotification *)noti
{

}

// UIKeyboardWillHideNotification
- (void)keyboardWillHide:(NSNotification *)noti
{

}

// UIKeyboardDidHideNotification
- (void)keyboardDidHide:(NSNotification *)noti
{

}


728x90
반응형

댓글