'UIKeyboardBoundsUserInfoKey' 메소드가 더이상 지원되지 않을 예정이므로 다른 메소드를 

사용하여야 한다. 당장 SDK에서 제거 되는것은 아니지만 차기 버전에서 없어질 가망성이 있다.


- (void) keyboardDidShow:(NSNotification *) notif {

if (keyboardVisible ) {

return;

}

//NSDictionary *notification = [notif userInfo];

//NSValue * aValue = [info objectForKey:UIKeyboardBoundsUserInfoKey];

//CGSize keyboardSize = [aValue CGRectValue].size;

        //CGRect viewFrame = self.view.frame;

//viewFrame.size.height -= keyboardSize.height;

// 'UIKeyboardBoundsUserInfoKey' is deprecated

        // 위와 같은 Warning 발생하여 아래와 같이 수정

CGRect keyboardEndFrame;

CGFloat keyboardHeight;


[[notif.userInfo valueForKey:UIKeyboardFrameEndUserInfoKey] getValue:&keyboardEndFrame];


if ([[UIDevice currentDevice] orientation] == UIDeviceOrientationPortrait || [[UIDevice currentDevice] orientation] == UIDeviceOrientationPortraitUpsideDown) {

keyboardHeight = keyboardEndFrame.size.height;

}

else {

keyboardHeight = keyboardEndFrame.size.width;

}

CGRect viewFrame = self.view.frame;

viewFrame.size.height -= keyboardHeight;

scrollView.frame = viewFrame;

keyboardVisible = YES;

}



Posted by great-artist
,