I have a button in MyViewA and after clicking on the button search, I want to call MyViewB, passing the variable search. How can I call a different view after clicking a button ?
var search: String = "abc"
Button(action: {
MyViewB(keyword: self.search)
}) {
Text("Search")
}
Thank you