Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't click the buttons inside a TableViewCell in iOS 14 [duplicate]

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?

like image 613
tornic Avatar asked Sep 18 '20 07:09

tornic


1 Answers

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
like image 177
tornic Avatar answered Oct 31 '22 15:10

tornic