'Update height of UITableView inside UIView when keyboard shows up

I need to update the UITableView Height in my UIView.

I get the height of the keyboard when it shows up using this code:

 [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardDidShow:)
                                                 name:UIKeyboardDidShowNotification
                                               object:nil];

- (void)keyboardDidShow: (NSNotification *) notif{
    self.isKeyboardVisible = TRUE;
    // Get the size of the keyboard.
    CGSize keyboardSize = [[[notif userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;

    //Given size may not account for screen rotation
    int height = MIN(keyboardSize.height,keyboardSize.width);
    int width = MAX(keyboardSize.height,keyboardSize.width);

}

But how do i change the height of the tableview to be just above the keyboard? I need to do this in order all cells in uitableview to be visible while user is scrolling without the need to dismiss the keyboard. Ofcourse if the user dismisses the keyboard then i should increase the height of the uitableview back to the previous state. Any help appreciated.



Solution 1:[1]

Look at this solution, if you are using obj-c and do not use constraints: https://gist.github.com/TimMedcalf/9505416?permalink_comment_id=3256880#gistcomment-3256880

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alex JOk