I am trying that when I press the image it takes me to the link
I have this:
class CoverPillCell: TableViewCell {
@IBOutlet weak var imagePill: UIImageView!
@IBOutlet weak var imagenButton: UIButton!
this contains variables that later in the load function call the remoteconfig
height = CGFloat(promoPill?.image_height ?? 0)
width = CGFloat(promoPill?.image_width ?? 0)
target_url = promoPill?.target_url ?? ""
position = promoPill?.position ?? 0
if enabled == true {
enabled = ((promoPill?.enabled) != nil)
}
//This is what I'm trying to when tap go to the target url which is configured on the remote config
if imagenButton.isUserInteractionEnabled == true {
self.imagenButton.addTarget(self, action: #selector(tapPill(_:)), for: .touchUpInside)
}
And in the IBAction I'm trying this:
@IBAction func tapPill(_ sender: UIButton) {
let promoPill = getPromoPill()
target_url = promoPill?.target_url ?? ""
}