Tag: uigesturerecognizer

How to detect end of UISwipeGestureRecognizer?

From the Apple documentation A swipe is a discrete gesture, and thus the associated action message is sent only once per gesture. -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent*)event also doesn’t gets called when I use UISwipeGestureRecognizer How can I detect when the user lifts his finger?

How can we able to make table view work when Gesture is applied to self.view?

I have applied gesture on whole view and I want to interact with table view within self.view.I have applied custom gesture.that is as follows: #import “TouchEvent.h” #import <UIKit/UIGestureRecognizerSubclass.h> @implementation TouchEvent @synthesize xInc=_inc; @synthesize prev=_prev; @synthesize diff=_diff; -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self setState:UIGestureRecognizerStateBegan]; } -(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { [self setState:UIGestureRecognizerStateCancelled]; } -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent […]

Restrict UIPageViewController (with TransitionStyleScroll) pan gesture to a certain area

In my app I have a RootPageViewController which contains the UIPageViewController and one or more DetailPageViewController with a UITableView as a childview. DetailPageViewController / RootPageViewController – DetailPageViewController \ DetailPageViewController On top of every DetailPageViewController is a little space where it should be possible to swipe and get to the next DetailPageViewController. ——————- | | | […]

Capture only UIView 2 finger UIPanGestureRecognizer

I have a couple of UIScrollViews in my view controller. I want to overlay a view that captures a 2 finger swipe via UIPanGestureRecognizer which will not record the UIScrollView swipe gestures. When I put a transparent view over my content with a 2 finger pan gesture, my taps and 1 finger swipes are not […]

Keyboard dismiss and UITableView touch issue

So I have this UITableView that contains few rows, when clicked on a row, another UIViewController is pushed with the specific row details. My problem is that I want to dismiss keyboard with any touch on the screen (also on the UITableView), but when I do it, and click on the UITableView row, the keyboard […]

Objective C: GestureRecognizer in ViewController –> retain cycle?

I have the following property defined in the header file of one of my ViewControllers (VC): @property(nonatomic, retain) IBOutlet UIImageView *articleImageView1; In the implementation of the VC, in the method viewDidLoad, I attach TapRecognizers to these properties: UITapGestureRecognizer *captureImage1TapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self [self.articleImageView1 addGestureRecognizer:captureImage1TapRecognizer]; The VC holds strongly the UIImageView. Does this UIImageView also […]

How do I implement velocityInView: for a custom gesture recognizer?

I am implementing a custom UIGestureRecognizer subclass. I would like to implement velocityInView: the same way that UIPanGestureRecognizer has done it. But I’m not sure how to go about doing it. How do I calculate the velocity in pts / sec?

Make UIGestureRecognizer to receive touches started on subviews

I attached a custom UIGestureRecognizer to one UIView which fills almost the whole screen. This view contains a small subview which needs to receive normal touches as well. Problem: Touches started on this subview are not handled by the recognizer attached to its parent. I want the gestureRecognizer to be first priority and work even […]

ios- zoom and rotate a masked UIImageView

I’m new to iOS and need to have the needs below. Please give me some directions on how to do this. Thanks! Have an image(source) masked by another image (frame) User can drag,zoom, rotate the source image. The frame image keeps still. I know how to use CGImageCreateWithMask and how to put uiimageview inside a […]

UIBarButtonItem and UIGestureRecognizer

I have a UIView where i added a UITapGestureRecognizer: UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:)]; tapRecognizer.numberOfTapsRequired=1; tapRecognizer.numberOfTouchesRequired=1; [self.myView addGestureRecognizer:tapRecognizer]; I then add a UIToolBar with a button to the view: UIToolbar *topBar = [[UIToolbar alloc ]initWithFrame:CGRectMake(0, 0, self.myView.frame.size.width, 44)]; topBar.barStyle = UIBarStyleBlackTranslucent; UIBarButtonItem *logout = [[UIBarButtonItem alloc] initWithTitle:@”Logout” style:UIBarButtonItemStyleBordered target:self action:@selector(logout)]; [topBar setItems:@[logout] animated:NO]; […]