uitapgesturerecognizer

Handling Tap Gesture in a UICollectionView

落花浮王杯 提交于 2019-12-07 05:34:22
问题 since I couldn't use any framework to create an photo album, I'm trying to create my own using Collection View, but I got stuck right at the beginning. My goal is to display all images from my web service into my collection view, since all displayed, the next step is when someone taps on any cell, I can open it in a new view and also navigate between all. here is the basic code that I created: - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view.

UITapGestureRecognizer crashes on multiple taps

扶醉桌前 提交于 2019-12-07 03:39:56
问题 I am adding UIImageView into UIScrollView programmatically and adding a tap gesture on imageView. It recognizes the tap event exactly 4 times and on fourth time it crashes without any clear error message. This is in the controller named FeaturedListingDetailVC Code: let frame = CGRect(x: 0, y: 0, width: 128, height: 128) _iv = UIImageView(frame: frame) _iv.image = UIImage(named: "no_media") _iv.userInteractionEnabled = true tapGesture = UITapGestureRecognizer(target: self, action: #selector

UITapGestureRecognizer not work when I animate the UIImageView

早过忘川 提交于 2019-12-06 23:50:44
问题 When I want to animate the UIImageView , the UITapGestureRecognizer added to it can not work. WHY??? -(void) testTap:(id)sender { NSLog(@"Test tap..."); } -(void) testSlide { UITapGestureRecognizer* testTap = [[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(testTap:)] autorelease]; testTap.numberOfTapsRequired = 2; UIImageView* imageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tip_slide"]] autorelease]; [imageView setFrame:CGRectMake(40, 40, 200, 200)]

detecting finger up/down UITapGestureRecognizer

坚强是说给别人听的谎言 提交于 2019-12-06 20:50:05
问题 How can I know when the finger is down and when is it up with UITapGestureRecognizer ? The documentation says I should only handle UIGestureRecognizerStateEnded as tap so it means there is UIGestureRecognizerStateBegin when finger is down, but all I get is UIGestureRecognizerStateEnded . The code I use to register the recognizer is: [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)] 回答1: UITapGestureRecognizer is a discrete gesture recognizer, and therefore never

Single and double taps on UITableViewCell in Swift 3

非 Y 不嫁゛ 提交于 2019-12-06 11:21:51
问题 I have storyboard segue on TableViewCell, which I use for transfering to another VC on cell click in didSelectRowAt method. Now I made double tap TapGestureRecognizer to handle touble tap on cell. Problem is that on single tap, segue is performing and double tap is not working. Double tap works fine with clicking out of cell. Is possible to solve this somehow with my code so far? Or I need to delete segue and handle single tap and double tap separately. Thanks for any suggestions override

Tap gesture to part of a UITextView

混江龙づ霸主 提交于 2019-12-06 09:42:01
问题 I have this code: UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapResponse)]; singleTap.numberOfTapsRequired = 1; [_textView addGestureRecognizer:singleTap]; This will react to the entire UITextView, but is it possible to change it so that it only responds to when a certain part of the string in the UITextView is tapped? Like a URL for example? 回答1: You cannot assign tap gesture to particular string in normal UITextView. You can

How to detect bumps via Apple TV Siri Remote

删除回忆录丶 提交于 2019-12-06 07:12:18
问题 I'm unable to find any documentation relating to right and left bumps on the new Apple TV Siri Remote. You can see this in action at 1:00 of this video, Hands On: Apple TV 2015 Bluetooth Touch, Motion & Siri Remote. Remote and Interactions mentions positional taps, but these bumps are triggered by the accelerometer, suggested by the video. Are these bumps actually positional taps? How can I detect left and right bumps ? 回答1: Tapping (without clicking the physical button) on the edges of the

MpMovieplayerController tap gesture recognizer doesn't trigger when in fullscreen

放肆的年华 提交于 2019-12-06 05:39:48
问题 I´m trying to use UITapGestureRecognizer in order to handle the taps on my fullscreen video. If I omit [self.player setFullscreen:YES animated:NO]; it works, but then my video won't scale to fit the screen. From my .m: - (void)viewDidLoad { [super viewDidLoad]; NSString *videoPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mov"]; player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:videoPath]]; player.shouldAutoplay = NO; player.view.frame = self

UITapGestureRecognizer issue in iOS 9

房东的猫 提交于 2019-12-05 16:23:57
问题 I guys, today I've updated my iPhone to iOS 9 and now have problems with a gesture recognizer. This is the error: WARNING: A Gesture recognizer (; target= <(action=onVideoTap:, target=)>>) was setup in a storyboard/xib to be added to more than one view (->; layer = >) at a time, this was never allowed, and is now enforced. Beginning with iOS 9.0 it will be put in the first view it is loaded into. I didn't have this problem with iOS8. The view contains a UIImageView and a TextView. The

UITapGestureRecognizer crashes on multiple taps

笑着哭i 提交于 2019-12-05 06:29:15
I am adding UIImageView into UIScrollView programmatically and adding a tap gesture on imageView. It recognizes the tap event exactly 4 times and on fourth time it crashes without any clear error message. This is in the controller named FeaturedListingDetailVC Code: let frame = CGRect(x: 0, y: 0, width: 128, height: 128) _iv = UIImageView(frame: frame) _iv.image = UIImage(named: "no_media") _iv.userInteractionEnabled = true tapGesture = UITapGestureRecognizer(target: self, action: #selector(initImagePopup(_:))) _iv.addGestureRecognizer(tapGesture) _iv.widthAnchor.constraintEqualToConstant