|
Hello! I successfully made a generic fetchRequest like Paul is showing in Dynamically filtering @FetchRequest with SwiftUI - CoreData SwiftUI Tutorial 6/7. All is working absolute fine but i cannot implement the .onDelete modifier. Does anyone have a solution for that? Please find my code below. Thanks a lot in advance! Martin My FetchRequest View:
My Content View:
|
|
I guess your .onDelete should be added on the list i.e.
Or try like this..
the deleteBooks func should be in the struct FetchedListView and as below:
You should add also the below in the FetchedList View file
Give it a try.. |
|
...thanks @Bnerd, unfortunatly it's not working. I triggers following error: Value of type 'Content' has no member 'onDelete' or Value of type 'List<Never, ForEach<FetchedResults<T>, Fetchedesults<T>.Element Content>>' (aka 'List<Never, ForEach<FetchedResults<T>, T, Content>>') has no member 'onDelete' |
|
Ok change it to the below:
|
|
Dearest @Bnerd, you are a star! thanks a lot, all is working now! and i learned a lot! Regards, Martin |
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.