A compact profile editing screen shows the user name and an Email alerts toggle. After a recent change, the screen sometimes displays an old toggle value and stops preserving edits when returning to a previously opened profile.
Profile object and display its current fields.Profile with the same id, the form must still reflect the new input data.Save must send the current form state through onSave.A.Email alerts toggle, but do not press Save.Profile with the same id, but with a different emailAlerts value and a different name.B, save the changes, and return to profile A again.onSave for each profile.Profile, not only when id changes.onSave should receive the data for the profile currently open on the screen, with the current form values.Swift 6, SwiftUI, iOS 18 SDKSwift 6MainActorProfile without recreating the processUse line comments to explain the problem, its impact, the fix and how to test it.