uipangesturerecognizer

With UIPanGestureRecognizer, is there a way to only act so often, like after x many pixels were panned?

我只是一个虾纸丫 提交于 2019-12-21 03:42:11
问题 Right now my UIPanGestureRecognizer recognizes every single pan, which is great and necessary, but as I'm using it as a sliding gesture to increase and decrease a variable's value, within the method I only want to act every so often. If I increment by even 1 every time it's detected the value goes up far too fast. Is there a way to do something like, every 10 pixels of panning do this, or something similar? 回答1: You're looking for translationInView:, which tells you how far the pan has

How to stop UIPanGestureRecognizer when object moved to certain frame

浪子不回头ぞ 提交于 2019-12-20 18:43:16
问题 I have an object of image type which I am moving using UIPanGestureRecognizer, and I need to stop recognizing the UIPanGestureRecognizer when the object reaches a certain frame. UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)]; [panRecognizer setMinimumNumberOfTouches:1]; [panRecognizer setMaximumNumberOfTouches:1]; [panRecognizer setDelegate:self]; [templatePhotoPlaceholderView addGestureRecognizer:panRecognizer]; -(void

Tinder-Like Swipe Animation for iOS

纵饮孤独 提交于 2019-12-20 16:22:11
问题 I've followed this very helpful tutorial on how to add tinder-like swiping (http://guti.in/articles/creating-tinder-like-animations/); however, I have one problem- when the picture goes away, I want to replace it with another picture. How/where do I do that? 回答1: I built a simpler and more comprehensive project based on that tutorial. In particular, you could use an array of images and assign each card an image based on the index of the image. Will the images be dynamic or static? Might not

Tinder-Like Swipe Animation for iOS

牧云@^-^@ 提交于 2019-12-20 16:21:48
问题 I've followed this very helpful tutorial on how to add tinder-like swiping (http://guti.in/articles/creating-tinder-like-animations/); however, I have one problem- when the picture goes away, I want to replace it with another picture. How/where do I do that? 回答1: I built a simpler and more comprehensive project based on that tutorial. In particular, you could use an array of images and assign each card an image based on the index of the image. Will the images be dynamic or static? Might not

Full swipe UITableViewCell to delete UITableView iOS 8

左心房为你撑大大i 提交于 2019-12-20 10:28:03
问题 I'd like to mimic the swipe to delete function of a UITableViewCell just like the mail app in iOS 8. I'm not referring to swipe to reveal a delete button. I'm referring to when you swipe, it discoloses 3 actions, but if you keep swiping to the left, the email is deleted. In iOS 8, UITableView has a new method where you can provide the data to display any number of buttons: #ifdef __IPHONE_8_0 - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath

Making a slide up view similar to the new Google Maps iOS app, troubles with multiple UIPanGestureRecognizer

☆樱花仙子☆ 提交于 2019-12-20 09:45:20
问题 I am trying to reproduce the behaviour of the slide up menu of the new iOS Google Maps application. So basically it's a view that you can slide up with panning up to a certain point or slide down to a certain point. This view can also with sliding to the right and to the left like a paginated scroll view. It should either scroll up and down or slide to the side but not both at the same time. After a lot of research and testing I have something that's close but not quite working like need it

How to determine true end velocity of pan gesture?

半腔热情 提交于 2019-12-18 12:01:23
问题 When using UIPanGestureRecognizer and detecting UIGestureRecognizerStateEnded , then the velocity of the gesture is not the true velocity. Instead, it's the old velocity of the previous invocation of my action method. How can I access the true velocity at the end of the gesture? I create my UIPanGestureRecognizer like this: UIPanGestureRecognizer* panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)]; [panGestureRecognizer

Prevent UIScrollView's UIPanGestureRecognizer from blocking UIScreenEdgePanGestureRecognizer

核能气质少年 提交于 2019-12-18 10:55:10
问题 I have a UIScrollView that fills the screen on one page of my app, but I want to allow the user to pan from the edge of the screen to reveal a view behind it. The problem is that the UIScrollView steals the touches from my UIScreenEdgePanGestureRecognizer at the edge of the screen. Unfortunately, I can't access the UIScreenEdgePanGestureRecognizer from the view controller that has the UIScrollView (and vice-versa), so I am not able to use the method requireGestureRecognizerToFail: because I

Prevent UIScrollView's UIPanGestureRecognizer from blocking UIScreenEdgePanGestureRecognizer

ε祈祈猫儿з 提交于 2019-12-18 10:55:03
问题 I have a UIScrollView that fills the screen on one page of my app, but I want to allow the user to pan from the edge of the screen to reveal a view behind it. The problem is that the UIScrollView steals the touches from my UIScreenEdgePanGestureRecognizer at the edge of the screen. Unfortunately, I can't access the UIScreenEdgePanGestureRecognizer from the view controller that has the UIScrollView (and vice-versa), so I am not able to use the method requireGestureRecognizerToFail: because I

ios UICollectionView detect scroll direction

情到浓时终转凉″ 提交于 2019-12-18 03:17:33
问题 I have a collectionView. I want to detect scroll direction. I have a two different animation style for scroll down and scroll up. So I must learn scroll direction. CGPoint scrollVelocity = [self.collectionView.panGestureRecognizer velocityInView:self.collectionView.superview]; if (scrollVelocity.y > 0.0f) NSLog(@"scroll up"); else if(scrollVelocity.y < 0.0f) NSLog(@"scroll down"); This is just work at finger touched. Not work for me 回答1: Try this: Add this somewhere in you header: @property