I will explain the scenario to be as clear as possible to understand the issue:
In the main screen of my app I have 4 UIButton
and each one of them will open a different screen containing each one its own UITableVIew
and its contents.
The buttons are as follows:
Restaurants button - > It will open UITableView
with a different restaurant in each cell.
Stores Button - > It will open a UITableView
with one store for each cell.
Places Button - > It will open UITableView
with distinct places in each cell.
Hotel Button - > It will open UITableView
with a particular hotel in each cell.
With this scenario, I would need to create a UIViewController
for each screen and its UITableView
. What ends up "polluting" the Storyboard code and screen.
I would like to know a way to use only a single screen to display (with UITableView
implemented) to display these contents separately, according to the button chosen, since the display layout will follow the same pattern. The solution I thought would be to use the tag
property of UIButton
to distinguish the buttons and load the appropriate content.
In case what I want to know is: How to show different content using the same UITableView
, distinguishing the content to be shown through the selected button?
Any questions about the issue just leave a comment that I can explain again if necessary.