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
jonathan hegranes
2,868 PointsIs there a way to keep track of the segue that was triggered to arrive at a current view controller?
I'm wondering if there's a way to direct a user based on where they came from in the app, and was thinking about doing this by keeping track of the segue that was triggered to arrive at the current view controller.
Essentially, if user arrived on ViewControllerOne by Segue A, then Segue B.
Or if user arrived on ViewControllerOne by Segue Z, then Segue C.
2 Answers
Caleb Kleveter
Treehouse Moderator 37,862 PointsIn the Build a playlist browser app course Pasan shows how in the top right corner of the app there's a button that when tapped will take you back to the previous view controller in This video.
jonathan hegranes
2,868 PointsThanks Caleb, but that video is more about hierarchical structures. I'm wondering about apps with different paths.
e.g. that video just talks about going from VC1 to VC2 and then back to VC1.
I'm curious about a path where a user is on VC2 and I either want to send him to VC3 if came from VC1 OR send him to VC4 if he came from VC0.
Caleb Kleveter
Treehouse Moderator 37,862 PointsOkay. I'm sorry, buT I'm just not that advanced yet
jonathan hegranes
2,868 PointsNo worries, Caleb. Me either :)