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

1169 questions
255
votes
35 answers

Create tap-able "links" in the NSAttributedString of a UILabel?

I have been searching this for hours but I've failed. I probably don't even know what I should be looking for. Many applications have text and in this text are web hyperlinks in rounded rect. When I click them UIWebView opens. What puzzles me is…
Lope
  • 4,836
  • 4
  • 27
  • 40
219
votes
19 answers

UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath

I have written my own function to scroll text fields up when the keyboard shows up. In order to dismiss the keyboard by tapping away from the text field, I've created a UITapGestureRecognizer that takes care of resigning first responder on the text…
Jason
  • 4,977
  • 4
  • 15
  • 11
189
votes
12 answers

UIButton inside a view that has a UITapGestureRecognizer

I have view with a UITapGestureRecognizer. So when I tap on the view another view appears above this view. This new view has three buttons. When I now press on one of these buttons I don't get the buttons action, I only get the tap gesture action.…
V1ru8
  • 5,979
  • 3
  • 26
  • 42
161
votes
9 answers

UITapGestureRecognizer - single tap and double tap

I am trying to add 2 UITapGestureRecognizers to a view, one for single tap and one for double tap events. The single tap recognizer is working as expected (on its own). But I don't seem to be able to get the double tap recognizer working. Have…
Stanley
  • 4,292
  • 6
  • 28
  • 47
152
votes
11 answers

How to make a UILabel clickable?

I would like to make a UILabel clickable. I have tried this, but it doesn't work: class DetailViewController: UIViewController { @IBOutlet weak var tripDetails: UILabel! override func viewDidLoad() { super.viewDidLoad() …
Daniele B
  • 16,703
  • 21
  • 96
  • 154
101
votes
8 answers

Click Event on UIImageView programmatically in ios

I am displaying a image from code here is the code UIImageView *preArrowImage =[[UIImageView alloc]init ]; preArrowImage.image =[UIImage imageNamed:@"arrowprev.png"]; preArrowImage.frame = CGRectMake(20, 60, 10, 30); [self.view…
Sumit Patel
  • 2,437
  • 8
  • 30
  • 43
101
votes
12 answers

UITapGestureRecognizer tap on self.view but ignore subviews

I need to implement a feature that will invoke some code when I double tap on the self.view (view of UIViewCotroller). But the problem that I have other UI object on this view and I don't want to attach any recognizer object to all of them. I found…
Matrosov Alexander
  • 20,713
  • 42
  • 130
  • 259
86
votes
5 answers

UITapGestureRecognizer - make it work on touch down, not touch up?

What I'm using the tap event for is very time-sensitive, so I'm curious if it's possible to make UITapGestureRecognizer activate when the user simply touches down, rather than requiring them to touch up as well?
user212541
  • 1,798
  • 1
  • 20
  • 29
72
votes
5 answers

Passing through touches to UIViews underneath

I have a UIView with 4 buttons on it and another UIView on top of the buttons view. The top most view contains a UIImageView with a UITapGestureRecognizer on it. The behavoir I am trying to create is that when the user taps the UIImageView it…
Magic Bullet Dave
  • 8,806
  • 9
  • 48
  • 81
59
votes
12 answers

tap gesture recognizer - which object was tapped?

I'm new to gesture recognizers so maybe this question sounds silly: I'm assigning tap gesture recognizers to a bunch of UIViews. In the method is it possible to find out which of them was tapped somehow or do I need to find it out using the point…
suMi
  • 1,506
  • 1
  • 15
  • 29
48
votes
5 answers

How do I implement the UITapGestureRecognizer into my application

I am quite new to programming and Objective C. I was wondering how to make an app which has a blank screen and a timer that goes for one minute. You are meant to tap as fast as you can and as long as you can for. I was wondering how to implement the…
47
votes
9 answers

Recognize tap on navigation bar title

Could someone please help me recognise a tap when a user taps on the Title in the Navigation Bar? I would like to recognise this tap and then animate the tableHeaderView appearing. Possibly sliding the TableView down. The idea being that the user…
Richard
  • 1,578
  • 3
  • 15
  • 21
44
votes
9 answers

ScrollView gesture recognizer eating all touch events

I have a UIScrollView to which I added a single tap gesture recognizer to show/hide some UI overlay using: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]; [scrollView…
Itai Hanski
  • 7,922
  • 4
  • 39
  • 62
38
votes
5 answers

iOS Detect tap down and touch up of a UIView

I am stuck with a problem of determining how to detect a UIView being touched down and UIView being tapped. When it is touched down, I want the UIView to change its background color. When it is touched, I would like the UIView to perform certain…
user288231
  • 935
  • 2
  • 12
  • 24
35
votes
5 answers

iOS 7.1 UITapGesture not working with UIPickerView

We are using a UIPickerView to allow a user to select from a list of options. We are adding UIPickerView as a subview of a container UIView. We are then adding a UITapGestureRecognizer to the container UIView. The UITapGestureRecognizer is being…
Anupam
  • 555
  • 1
  • 5
  • 13
1
2 3
77 78