Let's digest the preceding code:
- We're simply adding some IBOutlets and adding the IBAction login button.
- Over the loginEmail function, we're doing two things:
- If the user didn't provide any email/password, we're going to prompt them with an error alert indicating the necessity of having both fields.
- We're simply calling for the FIRAuth.auth().singIn() function, which in this case takes an Email and a Password. Then we're testing if we have any errors. Then, and only then, we might navigate to the app home screen or do anything else we want. We prompt them again with the Authentication Error message.
And as simple as that, we're done. The User object will be transported, as well, so you may do any additional processing ...