uitapgesturerecognizer

can't click UIButton inside a cell in UITableview

对着背影说爱祢 提交于 2019-12-20 19:36:24
问题 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: (NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault

UITapGestureRecognizer initWithTarget:action: method to take arguments?

↘锁芯ラ 提交于 2019-12-20 10:59:27
问题 I'm using UITapGestureRecognizer because I'm using a UIScrollView that acts as a container for my UILabel s. Basically I'm trying to use an action method with arguments so I can e.g. send myLabel.tag value to the action method to know what action to take depending on what UILabel has has been triggered by a tap. One way of doing it is having as many action methods as UILabel s but that isn't very "pretty" codewise. What I would like to achieve is just having one action method with switch

Unrecognized selector with UITapGestureRecognizer

那年仲夏 提交于 2019-12-20 07:32:04
问题 I'm trying to add in my app the possibility to dismiss the keyboard when the user taps somewhere else out of the text fields. I'm implementing this functionality using UITapGestureRecognizer. I create a new UITapGestureRecognizer object using the Unrecognized selector with UITapGestureRecognizer(target: Any?, action: Selector?) and set the action parameter to a function that resigns the first responder of both the text fields I'm using in this view. I set everything properly adding the

UILabel with Tap Gesture Recognizer not working

筅森魡賤 提交于 2019-12-20 04:26:14
问题 I have designed a UICollectionViewCell using XIB and in that custom cell I have an UILabel whose user interaction I have enabled. In my viewcontroller when I am designing the cell , Here is my code. UITapGestureRecognizer *buyNowTapped = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(buyNowClicked:)]; buyNowTapped.numberOfTapsRequired = 1.0; cell.buy.tag = indexPath.row; cell.buy.userInteractionEnabled = YES; [cell.buy addGestureRecognizer:buyNowTapped]; -(void

How get UITableView IndexPath from UITableView iphone?

对着背影说爱祢 提交于 2019-12-20 03:44:07
问题 In my iPhone app I have one messaging screen. I have added UITapGestureRecognizer on the UIViewController and also I have a UITableview on the screen. I want to select the UITableViewCell but I can't select the UITableView because of UITapGestureRecognizer . When I touch the screen, only the tap gesture action is called but UITableView delegate didSelectRowAtIndexPath: is not called. Could anyone please help me to work on both tap gesture and UITableView:didSelectRowAtIndexPath: . Thanks in

UITapGestureRecognizer on a text field not as expected

孤人 提交于 2019-12-20 03:05:52
问题 In my class I have 11 UITapGestureRecognizers in an array textViewRecognizer attached to 11 out of 100 UITextFields in an array boxArray. When a Textfield is tapped containing a UIGestureRecognizer it runs tappedTextView where I try to get the index of the first responder. However, due to some weird ordering in how things are executed, the action function only gives me the first responder of the previous first responder to the one that was just tapped. Also, I have to double tap to even

How to use tap gesture in Accessibility in swift?

风流意气都作罢 提交于 2019-12-20 01:39:27
问题 I'm working on app for blind people first i needed to use swipe gesture and after search i can do it by using override func accessibilityScroll( direction: UIAccessibilityScrollDirection)-> Bool { if direction == UIAccessibilityScrollDirection.Left { Do what you want to do } } Now I need to use tap gesture and I can't find any function to use make custom tap in Accessibility can anyone help me pleasee! Thanks 回答1: You shouldn't use tap gesture for UIAccessibility ot try to add tap gestures to

iOS5 Stable App Crashing in iOS4.3 Simulator

走远了吗. 提交于 2019-12-19 15:44:19
问题 i am getting an NSInvalidArgumentException with reason: -[UITapGestureRecognizer initWithCoder:]: unrecognized selector sent to instance my understanding was that UITapGestureRecognizers were supported in ios4.x? is it possible to load a different xib file for sub ios5 versions? 回答1: As @mit3z states in his comment on the original question, iOS 4.3 supports this feature only when setup up manually with code. It is not supported with Interface Builder. Apple would have saved us all grief over

shouldReceiveTouch on UITableViewCellContentView

 ̄綄美尐妖づ 提交于 2019-12-18 14:49:50
问题 I'm trying to ignore UITapGestureRecognizer taps on a UITableView with the following: - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { if ([touch.view isKindOfClass:[UITableViewCellContentView class]]) { return NO; // ignore the touch } return YES; // handle the touch } It won't compile: "Use of undeclared identifier 'UITableViewCellContentView' Undocumented class? Need to subclass? Better way to accomplish this? Thanks for any help. 回答1

Recognize tap on navigation bar title

瘦欲@ 提交于 2019-12-18 12:46:03
问题 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 can then select a quick option (from the tableViewHeader) to re-populate the TableView. However I cannot recognise any taps. I'm using Swift. Thank you. 回答1: UINavigationBar does not expose its internal view hierarchy. There is no supported way to