TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Ultimate Portfolio: ProjectView swipe-to-delete bug

Forums > SwiftUI

I'm at step 13 in the course. I haven't noticed this behavior before but I don't think I've changed the deletion code from the earlier step, so I may just not have been aware of the issue.

When swiping a list item row in the list, the wrong row and item are deleted.

Please note in the screenshot that the index offset is the 0th item, and the current item in the onDelete function is item 7 in the list at index 1. However, the wrong-row deletion is not one off each time, it seems to be that random rows are deleted for a given swipe-to-delete action.

Any ideas? Has anyone else seen this?

screenshot

3      

I think Paul do address this in a later video, but it to do with the sort order

let allItems = project.projectItems(using: sortOrder)

3      

Yep, thanks for your answer, you're right. Paul introduces the bug fix in the next lesson.

3      

Hacking with Swift is sponsored by RevenueCat.

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.

Learn more here

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.