Questions tagged [uitapgesturerecognizer]

UITapGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for single or multiple taps.

For the gesture to be recognized, the specified number of fingers must tap the view a specified number of times.

Although taps are discrete gestures, they are discrete for each state of the gesture recognizer; thus the associated action message is sent when the gesture begins and is sent for each intermediate state until (and including) the ending state of the gesture. Code that handles tap gestures should therefore test for the state of the gesture.

Whole document - UITapGestureRecognizer

1215 questions
34
votes
2 answers

tap gesture not recognized on uiimageview

I added two uiimageviews, one on another subview uiview (imageview1,imageview2). In the first view the top uiimageview is hidden(imageview2) and in the second view the bottom imageview is hidden(imageview1). Allocating tap…
31
votes
4 answers

How to capture Tap gesture on MKMapView

I am trying to capture tap event on my MKMapView, this way I can drop a MKPinAnnotation on the point where user tapped. Basically I have a map overlayed with MKOverlayViews (an overlay showing a building) and I would like to give user more…
31
votes
5 answers

How to detect double-taps on cells in a UICollectionView

I want to respond to double-taps on cells in a UICollectionView, and have a double-tap action cancel cell selection. This is what I've tried: UITapGestureRecognizer *tapRecogniser = [[UITapGestureRecognizer alloc] initWithTarget:self…
Cris
  • 1,939
  • 3
  • 23
  • 37
28
votes
8 answers

Tap on UISlider to Set the Value

I created a Slider (operating as control of the video, like YouTube has at the bottom) and set the maximum (duration) and minimum values. And then used SeekToTime to change the currentTime. Now, the user can slide the thumb of the slider to change…
senty
  • 12,385
  • 28
  • 130
  • 260
25
votes
4 answers

Problems with gesture recognizer in iOS 7

I'm adding several UIView objects (e.g. 5) to the screen, one inside the other. This, for example, view5.superview = view4, view4.superview = view3, view3.superview=view2, view2.superview = view1. For all these UIView I set uitapgesturerecognizer;…
Kup
  • 301
  • 1
  • 3
  • 9
24
votes
10 answers

How can I add a UITapGestureRecognizer to a UILabel inside a table view cell?

I am using a NIB file to layout a custom table view cell. This cell has a label with outlet called lblName. Adding a UITapGestureRecognizer to this label never fires the associated event. I have userInteractionEnabled = YES. I'm guessing that the…
Bryan
  • 8,748
  • 7
  • 41
  • 62
23
votes
1 answer

Button tap and long press gesture

I'm having a little trouble with the gestures. I'm trying to use both tap and long press on the same button, so I've used @IBAction func xxx (sender: UITapGestureRecognizer) and @IBAction func xxx (sender: UILongPressGestureRecognizer) but my…
Alvin Wan
  • 233
  • 1
  • 2
  • 5
22
votes
5 answers

iPhone iOS how to add a UILongPressGestureRecognizer and UITapGestureRecognizer to the same control and prevent conflict?

I'm building an iPhone app that would let the user rearrange some of the UI elements on the screen. How can I add a tap gesture recognizer and a long press gesture recognizer to the same UIView? When I lift up the finger from the long press, the…
Alex Stone
  • 46,408
  • 55
  • 231
  • 407
22
votes
2 answers

How to tap to zoom and double tap to zoom out in iOS?

I'm developing an application to display a gallery of UIImages by using a UIScrollView, my question is, how to tap to zoom and double tap to zoom out, how does it work when handling with UIScrollView.
Bruno
  • 1,032
  • 1
  • 16
  • 40
22
votes
14 answers

can't click UIButton inside a cell in UITableview

searched already some possible fixes but all did not solve mine. i keep clicking the cell in the uitableview rather than the buttons inside it. here is my code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: …
21
votes
2 answers

UITapGestureRecognizer with target - Swift

I tried to make a simple tap gesture and I can't figure it out. I want to add a target, simple selector to the gesture. Here is my code : var panGesture : UIGestureRecognizer = UITapGestureRecognizer.addTarget(<#UIGestureRecognizer#>) How can I set…
Ron
  • 331
  • 1
  • 2
  • 11
20
votes
14 answers

How to enable "tap and slide" in a UISlider?

What I want to get is a UISlider which lets the user not only slide when he starts on its thumbRect, but also when he taps elsewhere. When the user taps on the slider but outside of the thumbRect, the slider should jump to that value and then still…
Norbert
  • 4,239
  • 7
  • 37
  • 59
19
votes
6 answers

Tapping URL doesn't work in TTTAttributedLabel while there is a UITapGestureRecognizer on its superview

There is container view and a UITapGestureRecognizer on it. And it also has a subview which kind of TTTAttributedLabel. When I remove the gesture recognizer from the container view, the delegate method of TTTAttributedLabelDelegate -…
19
votes
3 answers

How can I shorten the time "delayTouchesBegan" delays touchesBegan?

In one of my view controllers I have several views that contain a UITapGestureRecognizer, along with an implementation of touchesBegan. I need to prioritize the taps over touchesBegan so I set the delaysTouchesBegan property of the gesture…
pasawaya
  • 11,515
  • 7
  • 53
  • 92
17
votes
7 answers

Swift - Tap gesture to dismiss keyboard UITableView

I have an identical question to this one , but since I'm new to programming and only really know swift I was wondering if someone could give me its equivalent in swift. Or point me to another question that I may have missed that is in swift.…
Leighton
  • 6,559
  • 7
  • 21
  • 28
1
2
3
80 81