Last active
August 15, 2019 16:13
-
-
Save WildStudio/252e87e7a1e806c68439f9adb20da36e to your computer and use it in GitHub Desktop.
Authentication failed message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct LoginView: View { | |
@State var username: String = "" | |
@State var password: String = "" | |
@State var authenticationDidFail: Bool = false | |
var body: some View { | |
VStack { | |
UsernameTextField(username: $username) | |
PasswordSecureField(password: $password) | |
Button(action: { | |
self.authenticationDidFail.toggle() | |
}) { | |
Text("Login") | |
} | |
if authenticationDidFail { | |
Text("Ooops, looks like the information is not correct. Please, try again.") | |
} | |
} | |
.padding() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment