call function from cell on a button in cell click

PHOTO EMBED

Tue Jan 11 2022 09:54:32 GMT+0000 (UTC)

Saved by @hasnat ##ios ##swift #function ##buttonclick #button #click #tap #pressed

cell.cellButton.tag = indexPath.row
            cell.cellButton.addTarget(self, action: #selector(yourFunc(sender:)), for: UIControl.Event.touchUpInside)
                                                            
@objc func yourFunc(sender: UIButton){
    let buttonTag = sender.tag
}
content_copyCOPY