Search code examples
swiftios14xcode12

An extra UITableViewCellContentView overlay appears in a TableView on iOS 14 preventing taps, but works fine on iOS 13


On an iOS 14 device compiled with XCode 12 an extra UITableViewCellContentView is appearing above the content of the table view preventing any of the buttons underneath it from being tapped. This only appears in iOS 14. It does not appear in iOS 13. Any ideas on how to remove it? enter image description here


Solution

  • 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