I've got a strange problem that I've been unable to solve.
I have a text field in a TableViewCell in a TableView. When I tap the cell a keyboard appears. I have the following code to dismiss said keyboard:
-(void) scrollViewDidScroll:(UIScrollView *)scrollView {
[self findAndResignFirstResonder:self.view];
}
The problem is, when a TextField is below where the top of the keyboard would be, the TableView scrolls so it is visible. This in turn triggers the scrollViewDidScroll method, which then dismisses the keyboard.