From bce174b5b1674e64154ca4f587f4da6ba911b7f0 Mon Sep 17 00:00:00 2001 From: oliverhnat Date: Wed, 1 May 2024 12:42:52 +0200 Subject: [PATCH] Fix delete flashcards Forgot to save after deleting the object --- README.md | 1 - WordAX/Views/FlashCardListView.swift | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 63af6ea..a28cb47 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ Why settle for pricey apps when you can have WordAX? We're here to prove that ef - [x] Implement logic - [ ] Make an apple watch version of the app - [ ] Option to add a hint -- [ ] Delete doesn't work - [ ] Add haptic touch

(back to top)

diff --git a/WordAX/Views/FlashCardListView.swift b/WordAX/Views/FlashCardListView.swift index 76d3f3b..58d9bf1 100644 --- a/WordAX/Views/FlashCardListView.swift +++ b/WordAX/Views/FlashCardListView.swift @@ -31,6 +31,11 @@ struct FlashCardListView: View { moc.delete(flashcard) } + do { + try moc.save() + } catch { + print("Something went wrong while deleting an object") + } }) } } else {