It seems to me that Apple is encouraging us to give up using UIViewController in SwiftUI, but without using view controlelrs, I feel a little bit powerless. Wha
I've found the answer. If you want to show another view on callback you should
1) Create state @State var pushActive = false
2) When ViewModel notifies that login is successful set pushActive to true
func handleSuccessfullLogin() {
self.pushActive = true
print("handleSuccessfullLogin")
}
3) Create hidden NavigationLink and bind to that state
NavigationLink(destination: ProfileView(viewModel: ProfileViewModelImpl()), isActive: self.pushActive) {
Text("")
}.hidden()