uigesturerecognizer

How can I determine if a user has pressed on a UITableViewCell for 2 seconds?

I am using gesture recognizers: Initialize in viewDidLoad: UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)]; [self.view addGestureRecognizer:longPressRecognizer]; This is what longPress looks like: - (void)longPress:(UILongPressGestureRecogni...

UILongPressGestureRecognizer gets called twice when pressing down

I am detecting if the user has pressed down for 2 seconds: UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; longPress.minimumPressDuration = 2.0; ...

UILongPressGestureRecognizer missing UIGestureRecognizerStateBegan state!

so I have implemented a 1-finger long-press gesture recognizer, but the recognizer always seems to be missing the UIGestureRecognizerStateBegan state... If I long press w/o moving finger and lift, I get the StateEnded debug message. If I long press and move finger a bit then lift, I get the StateChanged and StateEnded debug messages. But...

Use a UIPanGestureRecognizer to rotate view

Is it possible to rotate a view using a UIPanGestureRecognizer? I would like similar functionality to the rotation gesture but with only one finger. Thanks. ...

Using UITapGestureRecognizer to show/hide menus

Hi, I'm trying to find a good way to make a tap show/hide my menus, in the same way as iBooks. I set up UITapGestureRecognizer to do this, but unfortunately it means then that none of the buttons on the screen work. I know I can use tapRecognizer.cancelsTouchesInView = NO; in order to allow the touches to go through, but then of cour...

Calculate arc length / central angle of circle using Gesture Recognizers

I need to rotate a circle by an amount equal to the distance travelled by the users finger... This would equate to the length of the arc moved by the finger... I know the radius of the circle, but need to calculate the central angle and maybe the arc length. Can i do this using any functions in PanGestureRecognizer? translationInView? ...

Obtain previousLocationInView of GestureRecognizer's view

I am using a UIPanGestureRecognizer to rotate a circle. I need to know the start coordinate of the gesture and the end coordinate of the gesture. Would the start be locationInView and the end be translationInView provided i setTranslation to 0 at the end of the recognition? Eventually i need to calculate the angle between the two points...

Detect when the finger lifts after a UISwipeGesture[Recognizer]

I've set up a UISwipeGestureRecognizer: UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] initWithTarget:delegate action:@selector(handleSwipeGesture:)]; swipe.direction = UISwipeGestureRecognizerDirectionUp; [self addGestureRecognizer:swipe]; [swipe release]; A swipe makes the player move in the direction of the swi...

How do I chain two UIGestureRecognizers together?

What I would like to do is to detect a swipe gesture followed by a pan gesture as part of the same touch sequence. So the user first swipes an object to carry out an action, then, while keeping their finger on the screen, moves up/down to propagate the action to surrounding objects. I have a swipe gesture recognizer and a pan gesture r...

Combining a UILongPressGestureRecognizer with a UIPanGestureRecognizer

I d'like to combine a UILongPressGestureRecognizer with a UIPanGestureRecognizer. The UIPanGestureRecognizer should start with a long press. Is there a simple way to do this? or do I really have to write my own gesture recognizer? I wan't something like on the home screen. You press on an icon and after some time the icons start wobbl...

Does a UIPanGestureRecognizer take precedence over the -touchesMoved: method?

I'm not sure about this, but does a UIPanGestureRecognizer take precedence over a UIView's touch handling methods when it is added to that view? That is, will I still receive -touchesMoved: method calls from that view, or will I only get the callback from the gesture recognizer? ...

UITapGestureRecognizer only working for items visible on stage at initialization

So, I iterate through a loop and create UIViews which contain UIImageViews (So that I can selectively show any given part). These UIViews are all stored in a UIScrollView. I add gesture recognizers to the UIViews in the loop where I created them. When I run the program, only the items initially visible within the UIScrollView have thei...

Second touch after UILongPressGestureRecognizer has began

I'm using UILongPressGestureRecognizer and when I use one finger it works properly. When I lay down a second finger this is not captured by the recognizer, the delegate keeps being called but only with the first touch, [recognizer numberOfTouches] is always 1. If I set [recognizer setNumberOfTouchesRequired:2] it also works properly, I ...

UIPinchGestureRecognizer problem

I am using UIPinchGestureRecognizer.can i write two action for pinch in and pinch out..is there any specific Method(delegate)?I have written only one it is called when i pinched in... UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)]; [self.view addGes...

Why does a check for UIGestureRecognizer find it on iPhone OS 3.0, when it was introduced in 3.2?

I'm using UIGestureRecognizer for the first time and I want my app to run on iOS 3.0 onwards. Since Apple clearly states that the library is available in iOS 3.2 and later I used the following code: // Make sure that Gesture recognition technology is supportted by the device SDK version if ([UIGestureRecognizer instancesRespondToSelecto...

calling UIGestureRecognizers targets & actions

Hi, I wrote a subclass of UIGestureRecognizer using the initWithTarget constructor as well as addTarget, removeTarget methods. Now, my problem is that I am unable to find any accessors or helper methods to call these targets actions. I believe there should be any List/Array of targets and actions ... The docs are somehow weak in tha...

UIGestureRecognizer blocking buttons in table cell views

Hi, I am using a custom UIGestureRecognizer on a UITableView. As soon as I add the GestureRecognizer to the view, the buttons inside my table cells stop working (although changing the visible state to pressed, no action is being called). And I am using [self setCancelsTouchesInView:NO]; and no recognizer chaining or what-so-ever. Any...

Passing scroll gesture to UIScrollView from another view

Hi, I do have a view that has a UIScrollView and over it there is a view that display some text. When the user swipes over this view that contains text the UIScrollView won't scroll. How to make this view transparent in a way it relays the swipe gesture to UIScrollView. Thanks ...

bringSubviewToFront problem?

HI, I have Parentview-->Multiple childviews. when i use [self bringSubviewToFront:childview] in parentview, it works fine.but after adding grandchildview to childview,when i use [self bringSubviewToFront: grandchildview] in parentview, it did not work?any help please? ...

kickstarting a touchesMoved/UIPanGestureRecognizer mid-move for a new view

Hey all! Concept is that a user taps on an icon in a view, a copy of the icon pops up under the user's finger, and they can drag it around until they lift their finger. To do this, I desire the following icon has touch event add transparent whole screen UIView and paste a UIImageView containing the icon on it. track touchMoves or a u...