开发者

Handling touches in UITableViewController

开发者 https://www.devze.com 2022-12-23 03:57 出处:网络
I want to开发者_JAVA百科 implement the handling of an additional swipe gesture in my UITableViewController. However, it seems that in the case of tableviews the usual touch handling methods like -[tou

I want to开发者_JAVA百科 implement the handling of an additional swipe gesture in my UITableViewController. However, it seems that in the case of tableviews the usual touch handling methods like -[touchesBegan::] of the controller are not called. How can I handle touches on a UITableView?


Are you looking to implement a per-row swipe gesture? In that case, I'd override touchesBegan (etc.) in a custom UITableViewCell subclass (and make sure that your UITableViewDelegate does not enable the default swipe-to-delete behavior).

Otherwise, I think your best option is to overlay a custom UIView subclass over your UITableView and handle gestures there, making sure to relay any non-gesture-related events to the UITableView.

0

精彩评论

暂无评论...
验证码 换一张
取 消