I am recently working on an application which contains data stored in a dictionary. This data is then stored in a table which the user can view. This is how the data is stored:
Bill(Date: "4/28/18", Item: "something", Amount: 43.67)
I want to append data from a secondary view controller and the way I am currently trying to use is this:
ViewController().bills.append(Bill(Date: valueDate, Item: valueItem, Amount: Double(valueAmount)!))
The variables are all preset and work fine when I print them out and when I run this code in the initial view controller it works perfectly, but when I run the code above in the second view controller, no errors come up but it does not seem to append the data at all.
This is on Swift 4.1 Xcode 9.4.1