skip to Main Content

Ios swift – How to do programmatic navigation in swiftui using navigationstack once state changes?

struct LoginView: View { @State var isUserLoggedIn = false NavigationStack{ //..... Button { Task{ await viewModel.doLogin(email: email, password: password) } } label: { Text(Constants.LOGIN) .foregroundColor(Constants.BACKGROUND_COLOR) .font(Font.custom(Constants.FREDOKA_MEDIUM, size: 25)) .frame(maxWidth: .infinity) } }.onChange(of: isUserLoggedIn) { isUserLoggedIn in debugPrint(newPasswordValue) } } I…

VIEW QUESTION
Back To Top
Search