I have a tableViewController and for it I created a separate class. In this class there is a method:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("postCell", forIndexPath: indexPath) as! CustomPostCellTableViewCell cell.likeBTN.tag = indexPath.row cell.likeBTN.addTarget(self, action: #selector(FeedVC.likeClick(_:)), forControlEvents: .TouchUpInside) return cell } I can access any custom cell element through the cell. But inside this function. But I have one more function that works when I press a button in a cell. In this function, I get the cell number. But how can I now access the element of the desired cell and change it from this function (below)?
@IBAction func likeClick (sender: UIButton){ let indx = NSIndexPath(index: sender.tag) print(indx) } The task is as follows: I have in the table the posts in each cell. And in every post there is a button like. Clicking on the button should change the number of likes. How to implement this?