When I use TabView and select a TabItem, a chosen View will open right away.
TabView {
HomeView()
.tabItem {
Image(systemName: "house")
Text("Home")
}
}
Now I am trying to do the same, using button. However with button, the chosen View will open under .sheet or .fullScreenCover.
Button(text) {
self.isPresented.toggle()
}
.sheet(isPresented: $isPresented) {
self.content
}
How can I open the View using button, the same way it's opened using TabBar ?
Thx