I have a table view cell with a button like such
let downButton: UIButton = {
let button = UIButton()
button.translatesAutoresizingMaskIntoConstraints = false
button.addTarget(self, action: #selector(exe), for: .touchUpInside)
return button
}()
@objc func exe(product: Product) {
print("AEADSFADSF")
}
The button is added as a subview and displayed correctly but it doesn't execute the function added to it's target. If I have a function named exe on the Table View Controller, it executes. How can I make this work? I need the function to take a product as a parameter.