I have button in cell.swift file which has a button on it and this is the target function.
If I select the button and scroll down and go back up it get unselected again.
I've tried multiple variations of setSelected
and set highlighted but nothing is working.
func selectRecipient(sender:UIButton) {
if (!selectToShareButton.selected) {
selectToShareButton.selected = true
selectToShareButton.setImage(UIImage(named: "checkSelected"), forState: .Selected)
} else {
selectToShareButton.selected = false
selectToShareButton.setImage(UIImage(named: "checkUnselected"), forState: .Normal)
}
}