LoginViewController

class LoginViewController: GeneralUIViewController, UITableViewDelegate, UITableViewDataSource

This GeneralUIViewController controls the login view. It allows the user to login through Facebook, Google, E-mail, or Phone.

  • This table view sets up simple scrolling and reusable cells to simplify view layouts. This solution is more elegant than implementing a scroll view.

    Declaration

    Swift

    @IBOutlet weak var tableView: GeneralUITableView!
  • Setup the view.

    Declaration

    Swift

    override func viewDidLoad()
  • Returns the number of sections in this tableView.

    Declaration

    Swift

    func numberOfSections(in tableView: UITableView) -> Int
  • Returns the height of a given cell based on indexPath.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat
  • Returns the number of rows in this tableView.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int
  • Returns the cell using a reusable identifier based on the indexPath.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell
  • Unselects a row after it is selected by the user. This tableview does not need selection.

    Declaration

    Swift

    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
  • Returns the username that was typed in by the user.

    Declaration

    Swift

    func getuid() -> String?
  • Returns the password that was typed in by the user.

    Declaration

    Swift

    func getpw() -> String?
  • Once the user has logged in successfully, the rootViewController must be changed and a segue is taken to move the application to the demo page.

    Declaration

    Swift

    func userLoggedIn()
  • An action item for when the Facebook Login Button is clicked.

    Declaration

    Swift

    @IBAction func fbLoginButtonClicked(sender: AnyObject)
  • An action item for when the Google Login Button is clicked.

    Declaration

    Swift

    @IBAction func googleLoginButtonClicked(sender: AnyObject)
  • This function takes the information provided in this view’s CustomUITextField objects and sends the information to Firebase to attempt logging in. Any failure messages are shown to the user as a notification.

    Declaration

    Swift

    @IBAction func loginWithCredentials(_ sender: Any)