I have a TabBarController with 4 tabs. When the second tab is selected I would like to make an api call to get data & then, once the data returns, display the data in the destination view controller (let's call it SecondViewController).
I believe what I should do is wire up the SecondViewController to the TabBarController with a 'show' segue in the storyboard. However, it seems that I have to wire the TabBarController to the SecondViewController with a 'relationship segue' in-order to have the tab icon displaying. So I have both wired up.
When the second tab is selected the SecondViewController is immediately displayed before the necessary data is returned. Any thoughts on how to address this issue?
I have googled around for hours and have not found any helpful advice. A somewhat relevant stackoverflow question I have found is Prepare for Segue