uitapgesturerecognizer

tap gesture recognizer - which object was tapped?

我是研究僧i 提交于 2019-12-18 12:44:38
问题 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 that was tapped on screen? for (NSUInteger i=0; i<42; i++) { float xMultiplier=(i)%6; float yMultiplier= (i)/6; float xPos=xMultiplier*imageWidth; float yPos=1+UA_TOP_WHITE+UA_TOP_BAR_HEIGHT+yMultiplier*imageHeight; UIView *greyRect=[[UIView alloc

tap gesture recognizer - which object was tapped?

隐身守侯 提交于 2019-12-18 12:44:25
问题 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 that was tapped on screen? for (NSUInteger i=0; i<42; i++) { float xMultiplier=(i)%6; float yMultiplier= (i)/6; float xPos=xMultiplier*imageWidth; float yPos=1+UA_TOP_WHITE+UA_TOP_BAR_HEIGHT+yMultiplier*imageHeight; UIView *greyRect=[[UIView alloc

How to get the indexpath of a custom table view cell when an UIImage inside of it is tapped and captured by UITapGestureRecognizer in prepareForSegue

☆樱花仙子☆ 提交于 2019-12-18 09:44:33
问题 Ok a lot of variables in the title, sorry I couldn't make it any more simpler. First, I have a custom table cell with descriptions like so now, when a user taps on the cell itself, it would go to View A, however, there is a UITapGestureRecognizer that is connected to the UIImage at the left, which is connected to a segue that goes to View B. All is fine, but I need some data that is inside the table view cell that I can pass to View B so it can do some stuff once the view is shown. override

iOS: TapGestureRecognizer Issues

社会主义新天地 提交于 2019-12-18 05:29:10
问题 So I have an app that behaves like a photo gallery and I'm implementing the ability for the user to delete the images. Here is the setup: I have 9 UIImageViews, imageView, imageView2, etc. I also have an "Edit" button, and a tapGesture action method. I dragged a Tap Gesture Recognizer over onto my view in IB, and attached it to each one of the UIImageViews. I also attached the tapGesture action method to each of the UIImageViews. Ideally, I would like the method to only become active when the

Problems with gesture recognizer in iOS 7

让人想犯罪 __ 提交于 2019-12-17 22:30:32
问题 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; for view1-4 I just do NSLog(@"tap %@", self) in callback, while for view5 tap I set the following: delete view4 from the hierarchy, then put the same object view4' at the same place of the hierarchy. This object also contains view5' for which

Tap Gesture on part of UILabel

浪子不回头ぞ 提交于 2019-12-17 19:46:26
问题 I could successfully add tap gestures to a part of UITextView with the following code: UITextPosition *pos = textView.endOfDocument;// textView ~ UITextView for (int i=0;i<words*2-1;i++){// *2 since UITextGranularityWord considers a whitespace to be a word UITextPosition *pos2 = [textView.tokenizer positionFromPosition:pos toBoundary:UITextGranularityWord inDirection:UITextLayoutDirectionLeft]; UITextRange *range = [textView textRangeFromPosition:pos toPosition:pos2]; CGRect resultFrame =

tap gesture not recognized on uiimageview

[亡魂溺海] 提交于 2019-12-17 18:15:57
问题 I added two uiimageview s, 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 gesture: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(oneTap:)]; UITapGestureRecognizer *singleTap1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(oneTap:)]; Set user interaction for

UIButton inside a view that has a UITapGestureRecognizer

南笙酒味 提交于 2019-12-17 02:01:13
问题 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. So I'm not able to use these buttons anymore. What can I do to get the events through to these buttons? The weird thing is that the buttons still get highlighted. I can't just remove the UITapGestureRecognizer after I received it's tap. Because

UITapGestureRecognizer breaks UITableView didSelectRowAtIndexPath

て烟熏妆下的殇ゞ 提交于 2019-12-17 01:36:10
问题 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 field when tapping away. Now I've also created an autocomplete for the textfield that creates a UITableView just below the text field and populates it with items as the user enters text. However, when selecting one of the entries in the auto

UITapGestureRecognizer & tvOS remote for Pause/Play Button

喜欢而已 提交于 2019-12-13 19:40:44
问题 I am trying to create an action when a user clicks the pause/play button on the Apple TV Remote. I looked at the documentation, but the code Apple's documentation recommended does not work. Here is my code below. Could someone please tell me what I am doing wrong? Things to consider: I am using an AVPlayerMovieController & I do have another gesture recognizer in my code but for it is a swipe gesture AND this method is getting called, just not the Pause/Play. Can someone please help?