Gesture Recognizers and TableView

前端 未结 3 421
日久生厌
日久生厌 2021-02-02 17:13

I have a UIView which covers all of a UITableView. The UIView is using gesture recognizers for control of what the table displays. I still need the vertical UITableView scrollin

3条回答
  •  执笔经年
    2021-02-02 17:56

    If you need to know your cell's indexPath:

    - (void)handleSwipeFrom:(UIGestureRecognizer *)recognizer {
        CGPoint swipeLocation = [recognizer locationInView:self.tableView];
        NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:swipeLocation];
        UITableViewCell *swipedCell = [self.tableView cellForRowAtIndexPath:swipedIndexPath];
    }
    

    This was previously answered in UIGestureRecognizer and UITableViewCell issue.

提交回复
热议问题