I am creating an app and I am using .searchable for my home view, but once it is clicked, I want it to bring up a new view where results of what is being searched is shown, and once the cancel button is clicked goes back to the home view.
I currently have .searchable(text: $searchText)
and it is showing the search bar, and I have tried .overlay{SearchView()}
but it is just putting it over the home view. Is there a way to do this.