here's how it supposed to work
I have a login screen where the user logs in entering their username and password. (the UI is built programmatically)
the login screen inherits from UIViewController after the user clicks the sign-in I make a request to get their information from firebase. and then if the login is successful I create a variable such as
assign the information I grabbed from firebase to the created object student.
and then I do something like
my expectation here is that the value should pass to the tabbarviewcontroller.
My plan was to get the data to the tab bar view controller and when I have an array of view controllers say
HomeFeedViewController
ProfileViewController
SearchUserViewController
HistoryViewController
AddFriendViewController
i could create a student variable for each one of these view controller objects and pass the data from the tab bar view controller.
However, when I try to pass the object from loginViewcontroller to the tabbarviewcontroller, the properties are always nil.
here are some things I've gathered
I have a login screen where the user logs in entering their username and password. (the UI is built programmatically)
the login screen inherits from UIViewController after the user clicks the sign-in I make a request to get their information from firebase. and then if the login is successful I create a variable such as
Code Block let student = Student()
assign the information I grabbed from firebase to the created object student.
and then I do something like
Code Block let nextController = theTabBarControllerClass() nextController.student = student navigationController.pushViewController(nextController, animated: true)
my expectation here is that the value should pass to the tabbarviewcontroller.
My plan was to get the data to the tab bar view controller and when I have an array of view controllers say
HomeFeedViewController
ProfileViewController
SearchUserViewController
HistoryViewController
AddFriendViewController
i could create a student variable for each one of these view controller objects and pass the data from the tab bar view controller.
However, when I try to pass the object from loginViewcontroller to the tabbarviewcontroller, the properties are always nil.
here are some things I've gathered
From what I know this has nothing to do with the student object I created. I created a dummy string variable and tried to pass it, however, it was still nil.
I suspect that the problem lies within the fact that I am not too familiar with tabbarviewcontrollers since this is the first time I am working on them.