@Claude31
The purpose is to give the view a separate model to edit so no changes are made to the original until the user presses a "done" button. At that point, the original is updated and the context is saved. I used to do it differently, however, SwiftData doesn't always behave how you expect it to and I remember having some issues.
Yes, mileageHistory is an array of Mileage. I'll update the post to have more information on the Vehicle structure.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: