I have a UItableView that I am shrinking in size when a UIKeyboard is shown on screen, However there is the possibility that a Bluetooth keyboard can be used, I know that when a bluetooth keyboard is present UIKeyboardWillShowNotification will not be called.
So what I am doing is turning a bool on and off when the Bluetooth keyboard is connected however I am not sure how to detect when the UIKeyboard is disconnected, which is what I would like help with.
this is my code for detecting a Bluetooth keyboard.
- (void) viewdidload
//..
blueToothKeyBoardConnected = NO;
//..
- (void)UIKeyboardWillShowNotification:(NSNotification *)aNotification {
blueToothKeyBoardConnected = YES;
}
- (BOOL)textFieldShouldBeginEditing:(UITextField*)textfield {
// only change height if bluetoothkeyboard not present.
if (blueToothKeyBoardConnected == YES) {
int height = self.finishingTableView.frame.size.height;
self.finishingTableView.frame= CGRectMake(self.finishingTableView.frame.origin.x, self.finishingTableView.frame.origin.y, self.finishingTableView.frame.size.width, 307);
}
//..
Effectively I would like to know when I should be setting my boolean back to NO if and when the keyboard is removed.