1
I will explain the scenario to be as clear as possible to understand the question:
On the main screen of my app I have 4 UIButton
and each of them will open a different screen containing each its own UITableVIew
and its content.
The buttons are as follows::
Button Restaurants -> Will open a UITableView
with a different restaurant in each cell.
Store button -> Will open a UITableView
with a store for each cell.
Place button -> Will open a UITableView
with different places in each cell.
Hotel button -> Will open a UITableView
with a particular hotel in each cell.
With this scenario, I would need to create a UIViewController
for each screen and its respective UITableView
. What ends up "polluting" the code and the Storyboard 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 using the property tag
of UIButton
to distinguish buttons and press 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 doubt about the issue just leave a comment that I can explain again if necessary.
Your views are being made with
storyboard
orxib
?– Paulo Rodrigues
I am using Storyboard.
– Tiago Amaral