I have a UITableView with many items in it.
When I tap on an item, only one gets animated unto the second viewController. All is well.
But
When I tap on the back button, because all the cells on the previous screen has the same heroID, all the cells gets animated when moving back.
Is there a way to only make one cell animate when i tap the back button?
Nevermind. Found the answer.
I can set the values in viewDidLoad.
@patchthecode Can you elaborate on how you solved this?
I assumed you set the heroID value of the destination view in its viewDidLoad?
Doesn't seem to be working for me.
@v-ken in the UITableView function
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
i set the heroID of each cell to be the indexPath.row number. This made each cell to have a unique heroID.
Then when i select the cell, i pass the hero ID to the new viewController.
So when i tab back to the previous controller, only one heroID will animate.
hope this helps
Ahh ok! Thanks!
Most helpful comment
@v-ken in the UITableView function
i set the heroID of each cell to be the
indexPath.rownumber. This made each cell to have a unique heroID.Then when i select the cell, i pass the hero ID to the new viewController.
So when i tab back to the previous controller, only one heroID will animate.
hope this helps