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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From first view I will pass a sample data to Second View using the property called “data”.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters