通过cell里的UIView获得cell的indexpath

UIView* sender //cell

 

//首先获得Cell

    LoansListCell *cell = (LoansListCell *)sender.superview;//根据层级关系找到cell,如sender.superview.superview

 //然后使用indexPathForCell方法,就得到indexPath了~

    NSIndexPath *indexPath = [_loansList indexPathForCell:cell];

posted @ 2018-03-20 14:49  Holyday  阅读(122)  评论(0编辑  收藏  举报