In my SwiftUI app, I have a TabBar with 2 items:
a) TabItem1
b) TabItem2
However on the View itself, I created 2 buttons:
a) Button A
b) Button B
Now I need to switch TabBar items, using the buttons on the View. How can I do this ?
//call tabItem 1
})
{
Text("TabItem1")
}
Button(action: {
//call tabItem 2
})
{
Text("TabItem2")
}
****************************
TabView {
TabView1View()
.tabItem {
Text("TabItem1")
}
TabView2View()
.tabItem {
Text("TabItem2")
}
Thank you
a) TabItem1
b) TabItem2
However on the View itself, I created 2 buttons:
a) Button A
b) Button B
Now I need to switch TabBar items, using the buttons on the View. How can I do this ?
*******
//call tabItem 1
})
{
Text("TabItem1")
}
Button(action: {
//call tabItem 2
})
{
Text("TabItem2")
}
****************************
TabView {
TabView1View()
.tabItem {
Text("TabItem1")
}
TabView2View()
.tabItem {
Text("TabItem2")
}
Thank you