UISwipeGestureRecognizer *swipeGestureRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(resignTextView)];
swipeGestureRecognizer.direction=UISwipeGestureRecognizerDirectionDown;
swipeGestureRecognizer.numberOfTouchesRequired=1;
[self.tableview addGestureRecognizer:swipeGestureRecognizer];
-(void)resignTextView
{
[textView resignFirstResponder];
}
I do not know Why resignTextView method not get called?
The tableview has a scrollview and you can get the delegates of it to get the scroll events.
Check the docs for the UIScrollViewDelegate protocol, and implement the
-scrollViewDidScroll:or-scrollViewWillBeginDragging:methods as appropriate to your situation.Just implement the methods and it works since the tableview delegates implements the underlying scroll delegates.