10

In iOS 13 it works perfectly, but I am not able to make a simple tap on a button work within a TableViewCell. Is it happening to someone else? Has the way of doing this changed?

tornic
  • 747
  • 6
  • 15
  • If you want to customize cells by simply adding additional views, you should add them to the content view so they position appropriately as the cell transitions in to and out of editing mode. – Waylan Sands Oct 16 '20 at 23:29

1 Answers1

16

Solved!

You have to add your views to cell contentView like this:

contentView.addSubview(button)

and anchor your button to contentView:

button.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true
tornic
  • 747
  • 6
  • 15