In your cellForRowAt
method, do add tag number to the buttons
cell.bookMarkBtn.tag = indexPath.row;
Then
@IBAction func bookMarkBtnAction(_ sender: UIButton) {
sender.isSelected = !sender.isSelected
if(sender.tag == 0)
{
...
} else if (sender.tag == 1)
{
...
}
}