I have an app with a tab bar that has a few tabs with user-generated content. When each view controller loads, the viewDidLoad method makes HTTP requests to a server to fetch data, then populates its view correspondingly. Once all the data is loaded, however, the view remains the same (unless the view controller is unloaded and reloaded).
A lot of other apps with user-generated content has a similar behavior, except each view will reload if the app goes into the background then comes back into the foreground again. That is, as the user switches between the various tabs while the app is active, the content won't be automatically refreshed. If the user "quits" the app then comes back to it later, the views will be reloaded.
Are there standard practices for designing an app to behave this way? Specifically, I'm wondering if there are UIKit niceties that I can take advantage of to refresh my views on app "restarts".
Otherwise, I guess a straightforward approach is to have each view controller register for notifications in viewDidLoad and listen for the app entering the foreground. The controller can then respond to each notification by reloading its data.