I'm new in iOS development,
I have and "API Helper" Swift class that gets some data as a JSON array. And when the array is ready I want to call a method in my MasterViewController to update the tableView with the data.
I tried to do like that:
var facilities : [Facility]? {
didSet {
MasterViewController().facilitiesLoaded()
}
}
And then reload the tableView but without seeing anything.
I think the problem is that I'm creating a new instance of the ViewController, but what I should have is to get access to the current instance of the class.
Any idea, or a better design? Thanks..
MasterViewController. Maybe a better design would be to either use a callbackblockor useNSNotifications.