I'm writing an app in Swift that needs updating data from a server in the same way a chat app need. The difference is that I have multiple ViewControllers and they all need to be updated with the same data.
I've considered to use a timer in every Viewcontroller and activate my HTTP requests with it separately in every class.
My question is:
Can i activate the timer from AppDelegate and put the updated data in a singleton class and use it from all classes or maybe there is another way?
Create a timer, or job in your app delegate. Upon result use notificationcenter to push the result out to everyone who's listening. Just dont forget to both unsubscribe to the notificationcenter, and also stop the timer when the app closes.
If you need to retain the history it might be worth taking a look at RxSwift.