|
Im trying to add more functionalities to the iExpense App from the 100 days of SwiftUI. I was able to open a new page upon clicking the row of list and is able to update the information but is unable to save it. I need a code to save the details in the UpdateDetails View. I have marked the section I need help with. ContentView
AddView:
Expense Item:
Expense Model :
UpdateDetails :
|
|
Hello. I'm trying to save the updated data. If I use append, it will goto the end of the list and I will end up having two of the same items in the list. One with the original data and one with updated data. What I'm trying to do is when I press update I want the original data in the list to be replaced by the updated data. |
|
In your The reason why everytime a new item is created is: in your UpdateDetails View you create a new It's not useful to just copy the I would suggest:
Then try again and show us your progress. |
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.
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.