I will demonstrate today how to pass data between views in the SwiftUI by using property.
Let’s Create Second View
I have created second view with one property called data, in that we will display data which will be passed from first screen.
Let’s Create First View
From first view I will pass a sample data to Second View using the property called “data”.
In Second View you will able to see the text “Hello 2nd” by clicking on “Open Second View” Button on First View.
Conclusion
This is only simple JSON. You can try complex JSON responses!
Let me know if you have any questions, comments, or feedback – via Twitter.
Learn Something New. Share To The World.
Happy Coding 🙂