I have 2 ViewControllers and 2 classes for each of them.
In ViewController1, I have a dictionary(named 'data' of type [String:String]) containing user emailID, Password, First Name and Last Name.
I want to access this 'data' dictionary in the class of ViewController2 and append a few more elements (Age and Gender).
I tried to do this by creating instances of ViewController1 class to access the data and segue. When I'm printing the 'data' dictionary in the console before appending it is showing up empty and if I'm printing it after appending its only showing the latest elements in the dictionary (i.e. only age and gender)
How to pass the dictionary between classes so that it's elements also move with it and not just an empty dictionary ?