How to access data in Class globally in any ViewController in the project
If your objective is to access the data globally for temporary storage, just create a struct for your transaction: struct Transaction { let date: Date let quantity: Int let price: Double let code: String } Then just need to create a singleton and a property to store your transactions: class Shared { private init() { … Read more