I have two view one is LoginView. Another is WelcomeView. I want to go from LoginView to WelcomeView onclick button from LoginView.
Here is my code..
LoginView
struct LoginView: View { var body: some View { VStack{ Button(action: { print("*** Press go login view ****") }) { Text("Login") .font(.custom(TextConstant.keyValues.front_name, size: 30)) .foregroundColor(.white) .fontWeight(.bold) .frame(minWidth: 0, maxWidth: .infinity) .padding(.all,20) .foregroundColor(.blue) .background(LinearGradient(gradient: Gradient(colors: [.green, .green]), startPoint: .leading, endPoint: .trailing)) .cornerRadius(10) } } } }
Here is WelcomeView
struct WelcomeView: View { var body: some View { Text("Hello ") } }
I want to go another page on clcik button & back to previous onclick button. Please help.