How IOS adds a click event to the TableView blank without affecting some of the button's events in the cell

Source: Internet
Author: User

If you create a tableview and return a cell with only a few rows, not enough to fill the screen, and then you add a gesture on the tableview you created, how do you make the cell's click event not conflict with the Click event of the gesture? In fact, you just have to do one step: the proxy method for implementing gestures is as follows

-(BOOL) Gesturerecognizer: (Uigesturerecognizer *) Gesturerecognizer Shouldreceivetouch: (Uitouch *) Touch {
if ([Touch.view Iskindofclass:[uitableview class]]) {
return YES;
}

return NO;
}

This way when clicking on the cell when the cell's click event is performed properly, clicking on the TableView blank gesture's Click event also performs normally.

How IOS adds a click event to the TableView blank without affecting some of the button's events in the cell

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.