Hello. I am trying to make a signup/login page, but I can't fix this problem. I am very new to Swift, and everything online says what I am doing is right, but it won't work.
I have 2 files, ContentView, Login and SignUp.
When I do this SignUp()
, or Login()
it doesn't change views and stays the same. This is what I have tried on ContentView()
Text("Hello! Welcome.")
Button("I'm new") {
SignUp()
}
Button("I'm returning") {
Login()
}
It also gives a warning saying "Result of 'SignUp' initializer is unused" on both files. Does anyone know how I can make it so that when the button is pressed it actually changes views? Thanks!