Issue with switching views via custom code [SOLVED]

Good day,

I have been following the YT tutorial: Firebase Authentication Tutorial 2020 - Custom iOS Login Page (Swift) and I have been following Chris on creating the transition code from switching views at around mark 1:12:00 onwards. Since the problem I am having is that comparing my code to Chris is almost identical but his successfully switch to the HomeVC controller while mine was set at a blank dark screen.

here is my code from the project :

// SignUpViewController.swift
// LifeNotes
// Created by Ray Amago on 11/5/20.

import UIKit
import Firebase
import FirebaseAuth

class SignUpViewController: UIViewController {

@IBOutlet weak var firstNameTextField: UITextField!

@IBOutlet weak var lastNameTextField: UITextField!

@IBOutlet weak var emailTextField: UITextField!

@IBOutlet weak var passwordTextField: UITextField!

@IBOutlet weak var signUpButton: UIButton!

@IBOutlet weak var errorLabel: UILabel!

override func viewDidLoad() {

    // Do any additional setup after loading the view.

func setupElements(){
    errorLabel.alpha = 0

func validateFields() ->String? {
    if firstNameTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) == "" ||
        lastNameTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) == "" || emailTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) == "" || passwordTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) == ""
    { return "Please fill in all the fields"
    //Check password security measure
    let cleanedPassword = passwordTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
    if Utilities.isPasswordValid(cleanedPassword) == false {
        return "Please esure that password is at least 8 chracters, contains special characters and a number"

    return nil

@IBAction func signUpTapped(_ sender: Any) {
    //validate the fields

    let error = validateFields()
    if error != nil {
    }else {
        //Cleaned Data Entries
        let cleanedFirstName = firstNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
        let cleanedLastName = lastNameTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
        let cleanedEmail = emailTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
        let cleanedPassword = passwordTextField.text!.trimmingCharacters(in: .whitespacesAndNewlines)
        Auth.auth().createUser(withEmail: cleanedEmail, password: cleanedPassword) { (result, err) in
        //Check for errors
            if err != nil {
                self.showError("Error creating User")
            } else{
                //User successfully created
                let db = Firestore.firestore()
                db.collection("users").addDocument(data: ["firstname":cleanedFirstName,"lastname":cleanedLastName,"uid": result!.user.uid]) { (error) in
                    if error != nil {
                        self.showError("Error in saving user data on Firebase")
                //Transition to Home Screen
func showError(_ message:String){
    errorLabel.text = message
    errorLabel.alpha = 1

func transitionToHome(){
    let homeViewController = storyboard?.instantiateViewController(identifier: Constants.Storyboard.homeViewController) as? HomeViewController
    view.window?.rootViewController = homeViewController


I have tried swapping my code in the func transitionToHome() from Chris and tried if it change anything but still it provides me a blank black screen. Any help on this issue is greatly appreciated

Currently using Xcode 12.0

Edit: I would like to point out as well in this topic, I have successfully added new entries in my firebase each time a user signed up, but the next view does not show.

Good day!

I have found the issue that cause my screen to be blank when running our custom function in switching screens. I did not notice that I have not set the class of our HomeViewController properly in the story board thus Xcode is pointing to a non existing view. I have set the class properly and rebuild my project and now it works properly.

I have lost alot of time browsing for possible reason/solution on my issue rather than try to see if I have missed any key information.

I am now tagging my issue as resolved, i guess Wednesday blues are real.