Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Yumel Hernandez
Yumel Hernandez
11,902 Points

witch segue initiated the action

Im working on this app where users select a military branch from there it takes them to a screen based on witch branch they picked (I created a view controller to select the branch, and four different view controllers for each military itself because they all have different designs).

Once they get to a branch view controller, they will select something they want information to like uniform, rank etc.

Then the four branches are hooked to one single view controller, why? because they all have common things like uniform knowledge, rank and the only thing that could change is their information witch is stored in a array of dictionaries in separated class.

My question is how do I find out witch view controller(segue) initiated the action?

1 Answer

I Think what you need is to use one tableview and one view controller where if each row will contains the category of items and once a cell was selected you will push the view controller with the collection of items.

If you are using only view controller what you should is to push all three following view controller to first one.
Hope that helps

Yumel Hernandez
Yumel Hernandez
11,902 Points

Then the set up will look and feel unpleasant if i use a tableview

OK lol... just use your view controller and then push each view controller to the main one