Skip to content

Instantly share code, notes, and snippets.

@ksmandersen
Last active June 19, 2016 09:08
Show Gist options
  • Save ksmandersen/c41b6c0fea2ea9fde229ff926adff18d to your computer and use it in GitHub Desktop.
Save ksmandersen/c41b6c0fea2ea9fde229ff926adff18d to your computer and use it in GitHub Desktop.
Good Swift, Bad Swift - Part 2
@objc func didPressLogIn(sender: AnyObject?) {
guard !isPerformingLogIn else { return }
isPerformingLogIn = true
let email = contentView.formView.emailField.text
let password = contentView.formView.passwordField.text
guard validateAndShowError(email, password: password) else {
isPerformingLogIn = false
return
}
sendLogInRequest(email, password: password)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment