I need advice in situation: I have several JSON where may be several types of transport are (for example, only train (first variant) or train and bus (second variant). I know that there are only 3 types of transport maximum.
So, I'd like to show info from JSON about train in first view controller, info from JSON about bus in second end etc.
How better to do: create several view controllers (for maximum variants - 3), several tabBar.items (3) and when I get data from JSON in AppDelegate I will know: "OK, I know that in that JSON info only about train and I should show only tabBar.item = "train" and work only with TrainViewController and others tabBar.items I must hide from user? Is it good experience?
Your question will have multiple solutions to achieve your goal and totally depends on what kind of UI will attract your users. But along with the UI I will also advice you to consider the app size and code complexity.
If I would have to do this, I would have done like this:
1) Use single `ViewControlller` with `SegementedControl` on top having titles of your variants.
2) Whenever user selects the `segment`,load necessary data for that variant.
3) If you are going to show that data in list format, then It would be very easy to manage your `datasource` as you can simply replace the datasource depending on the selected variant.
This is not the exact or the only solution, but IMO this will reduce app size as you will be using single ViewController
instead of three and you can easily manage all your complexity in a single ViewController
class.