I’ve found the answer. If you want to show another view on callback you should
-
Create state
@State var pushActive = false -
When ViewModel notifies that login is successful set
pushActivetotruefunc handleSuccessfullLogin() { self.pushActive = true print("handleSuccessfullLogin") } -
Create hidden
NavigationLinkand bind to that stateNavigationLink(destination: ProfileView(viewModel: ProfileViewModelImpl()), isActive: self.$pushActive) { EmptyView() }.hidden()