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!
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
Andrés Leal
9,563 PointsWho to add a double tap like? "Instagram Like" in swift
I want to add a like button, when you double tap the view it shows the like, but I don't know how to do that, any ideas?
2 Answers

Carmine Sarno
19,660 PointsAndrés,
I'd suggest investigating using UITapGestureRecognizer, which is a subclass of UIGestureRecognizer. I haven't made a double-tap interface like you're describing, but I think that could be done by setting the numberOfTapsRequired property to 2.
Pasan covers using this class in the "Playlist Browser with Swift / Obj-C" course, so I'd check that out for implementation instructions. The specific video is called "Adding Touch Capabilities" in the "Building the Master and Detail Views" section.

Jhoan Arango
14,575 PointsWhen creating an app, in Xcode there are some gestures recognizers that can do that. :)
Andrés Leal
9,563 PointsAndrés Leal
9,563 PointsThank you!!