Skip to content

Instantly share code, notes, and snippets.

@PaulRBerg
Last active July 14, 2017 08:56
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 PaulRBerg/0a9a6a7600f035a0b2bb81e6b4fc7a11 to your computer and use it in GitHub Desktop.
Save PaulRBerg/0a9a6a7600f035a0b2bb81e6b4fc7a11 to your computer and use it in GitHub Desktop.
AdPacer - APLoginButtonController
import UIKit
extension APLoginViewController {
/**
* Called when the 'Sign In' (middle) button was tapped.
*/
@IBAction func didTapSignInButton(_ sender: Any) {
view.endEditing(true)
/**
* We proceed to sign up the user only if all the requirements are met.
*/
if !isDataValid() { /* @located in APLoginData.swift */
return
}
login() /* @located in APLoginNetwork.swift */
}
/**
* Called when the small 'Forgot Password' (to the right of password field) button was tapped.
*/
func didTapForgotPasswordButton(_ sender: Any) {
let storyboard = UIStoryboard(name: APConstant.kAPForgotPasswordStoryboard, bundle: nil)
let forgotPasswordViewController = storyboard.instantiateInitialViewController()!
navigationController!.show(forgotPasswordViewController, sender: self)
}
/**
* Called when the 'Forgot Password?' (bottom of the page) button was tapped.
*/
@IBAction func didTapForgotPasswordLabel(_ sender: Any) {
didTapForgotPasswordButton(sender)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment