The solution below works correctly only for names that fit on one line
cell.accessoryTitleLabel.text = data.title
cell.accessoryTitleLabel.sizeToFit()
cell.discountIcon.frame.origin.x = cell.accessoryTitleLabel.frame.maxX + 7
cell.discountIcon.hidden = discount == 0
But I need to put a discount icon at the end of the last line: