Skip to content

Instantly share code, notes, and snippets.

@WildStudio
Last active August 15, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WildStudio/252e87e7a1e806c68439f9adb20da36e to your computer and use it in GitHub Desktop.
Save WildStudio/252e87e7a1e806c68439f9adb20da36e to your computer and use it in GitHub Desktop.
Authentication failed message
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