|
My app displays comments, and users can like these comments. The app uses a diffable data source, and when I click on the last row to like the comment, the collection view scrolls to the centre. Here is a video of the issue https://streamable.com/9vijyx (sorry about he music, my baby daughter was dancing) Here is some of my code that I think is relevant - you'll see by the comments that I have tried to fix this issue by storing the content offset but it feels VERY hacky. Any help would be greatly appreciated.
|
|
Hey there, I got your source code from upwork and the problem is with your PostDetail model. You should change
TO
And change the rest of you code accordingly. You should also remove updateSnapshot and just use applySnapshot Cheers. |
|
Another possibility would be to just update the cell directly and don't rely on snapshot for this simple change. Without snapshot, you could get reference to the cell from the collection view and set it to like state. |
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.