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 trialSaloni Agarwal
9,240 PointsWhy did we connect segue with view controller and not with the gesture?
When we connect segue with view controller, we have to write performSegueWithIdentifier method which we don't need to write if we just connect the segue with the gesture (I tried it and it worked).
1 Answer
Alp Eren Can
25,230 PointsIf you had been following along with the course, you should have seen that it has to do with adding more UIImageViews with tap gestures doing the exact same segue. This way you create one segue with an identifier and perform the segue in the code repeatedly by just connecting the gestures to that single action.
Otherwise you'd have to drag every tap gesture to create the segue and then write the same identifier over and over again.
Hope this makes sense.