Search code examples
iosxcodetableviewcell

Update UITableViewCell from another View


I have a tableview filled with custom cells. In every cell there are two buttons and if I press the first one I navigate to another view, lets call it secondview.

On my secondview there is one button which has the same functionality as the second button on my cell from the previous tableview. When I press the button on my secondview I hide it, but I also want to hide the second button on my cell.

But attention! I only want to hide the second button on this particular cell where I pressed the first button, not all of them!

How can I do that? Thanks in advance!


Solution

  • You should pass the first view as a delegate to the second view and when the change is made in the second you will call the first view's hideSecondButton or whatever mwthod you make. Anyway, your problem's keyword is delegate.