I'm trying to implement in SwiftUI where you press a button in a view on one tab, it changes to another tab. I would do with UIKit:
if [condition...button pressed] {
self.tabBarController!.selectedIndex = 2
}
But is there an equivalent way to achieve this in SwiftUI?