My app application uses pure Swift, SwiftUI, & SwiftData. One view contains a quiz. After a user completes a quiz I would like to display the results in another separate view.
My specific problem is passing data to sibling views (from origin view to destination view). If anyone could help I would appreciate it.
I’m using
- @Model macro above my class
- .modelContainer for designing/ designating the container
- @Envioronment variable to insert the data into the context of the origin view.
- Add same data (quiz result) to destination view.