iOS 15: Deleting from a Core Data fetch request – Bookworm SwiftUI Tutorial 9/10

preview_player
Показать описание

Other parts in Project 11:

9. Deleting from a Core Data fetch request: This video

Рекомендации по теме
Комментарии
Автор

how does this code:
onDelete(perform: deleteBooks)
carry the argument/param for the index of the book selected to be deleted?
Moreover how does the actual body of the deleteBook itself know which book to delete and not just delete them all in the "for _ in _" loop?
Does IndexSet do this work?

littlebrotha
Автор

Hi Paul,
Firstly thank you for the excellent work you are doing here. Really well explained and backed up with documentation.
I am still new to Swift, and want to subscribe to your products, but not sure which one.
I've tried this example, but the delete icon crashes the app, can you help?

KeithBurton-mj
Автор

Is there a way to update an entity that is saved in core data based on its title? 
When I save a new entry I end up with many entries with same title.
I was thinking to delete the already present entry and create a new one.
But in that case how do you find the entity to delete based on its title and not by doing swipes?

alex
Автор

why we are using List{
ForEach(books)
}

rather than only List(books){}
this is done only to attach modifier onDelete?

MoAdel
Автор

Is there any way to move the add and delete method to a separated Swift file instead of keeping it in the SwiftUI View file?

Enzo-spbf