0

In my app, the users can like specific cells. Everything works perfectly up until I search for a specific post and like it. In the photos, I search up "Ghastly" which before searching and filtering is the 4'th cell.

So when I search it and like it during a search and then exit the searching, the cell that gets liked is always the first. Or, if I search a post that is the 3rd cell during searching, then the third cell in the main UITableView is liked. I want it to be to where I like a specific post, exit the search, and that same post shows like.

Once I close my app and start it again then the liked buttons are on the correct cells.

  • What does 'let indexPath = IndexPath(row: (sender as AnyObject).tag, section: 0)' mean? – El Tomato Apr 26 '21 at 08:11
  • that is used to get the specific row the user is tapping. So if the user taps the like button in a certain cell, that returns the cell number –  Apr 26 '21 at 08:13

0 Answers0