UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Table View + Core Data + Soft deletions - need to fix animations

Forums > iOS

Hello all,

I am using soft deletion with NSFetchedResultsController meaning I am setting wasDeleted flag to true and then filter out these items. I have the standard delegate methods implemented that handle Table View updates (controller(_:didChange:at:for:newIndexPath:)) which works but the animation for deletion is wrong because it thinks that it is an update and not deletion so I get blank space and then the cells reorder.

I thought Diffable Data Source may solve it so I have implemented it but the issue is exactly the same meaning wrong animation on delete.

Is this too far an edge case? Should I instead opt for another model that will store deleted stuff (I need it for iCloud cleanup) and just delete those entities regularly?

3      

BUILD THE ULTIMATE PORTFOLIO APP Most Swift tutorials help you solve one specific problem, but in my Ultimate Portfolio App series I show you how to get all the best practices into a single app: architecture, testing, performance, accessibility, localization, project organization, and so much more, all while building a SwiftUI app that works on iOS, macOS and watchOS.

Get it on Hacking with Swift+

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

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.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.