Delete a row from table view using custom button - Swift 3

后端 未结 1 1694
情书的邮戳
情书的邮戳 2021-01-26 16:47

How to delete a row from tableview using custom buttom

//CustomCell.swift

protocol FavoriteCellDelegate {
    func deleteButton(sender:CustomCell)
}

class Favo         


        
相关标签:
1条回答
  • 2021-01-26 17:01

    you can get indexPath using table view point like this

    let buttonPosition : CGPoint = sender.convert(sender.bounds.origin, to: tableview)
    let indexPath = tableview.indexPathForRow(at: buttonPosition)
    
    0 讨论(0)
提交回复
热议问题