Questions tagged [uigesturerecognizer]

UIGestureRecognizer is an abstract base class for concrete gesture-recognizer classes. A gesture-recognizer object (or, simply, a gesture recognizer) decouples the logic for recognizing a gesture and acting on that recognition. When one of these objects recognizes a common gesture or, in some cases, a change in the gesture, it sends an action message to each designated target object.

Filter by
Sorted by
Tagged with
2 votes
1 answer
109 views

Custom UIControl does not work with UITapGestureRecognizer

When the UITapGestureRecognizer is not added to the view, both the UIButton and CustomControl will receive the .touchUpInside event. However, when the UITapGestureRecognizer is added to the view, only ...
catmotionmachine's user avatar
2 votes
1 answer
67 views

Detect touches and ignore other gestures Swift SceneKit

I have an interactive globe and I want to detect taps on the globe, so I can get their 3d position. When I override the function public override func touchesBegan(_ touches: Set<UITouch>, with ...
ahmed's user avatar
  • 255
0 votes
1 answer
31 views

Updating a UIView with a subview's gesture handler

I have a simple app with a single ViewController containing a very minimal view hierarchy: DrawingView (a subclass of UIView), and three ImageViews (which are each children of DrawingView). Inside ...
vonbecker's user avatar
0 votes
1 answer
89 views

MAUI Tap Gesture on Hyperlink not working

Implemnted code below "Create a reusable hyperlink class" at MS Learn MAUI:Entry to add a Hyperlink. The Tap Gesture is added but does not fire the Tap handler. There is some discussion of ...
David Jones's user avatar
0 votes
0 answers
38 views

Event response priorities for gesture recognizers, UIControl, and UIButton

I have a parent view with a gesture recognizer added. The parent view contains a UIButton and a UIControl, with corresponding actions added respectively. The code is as follows class MyViewController: ...
Yasic's user avatar
  • 69
1 vote
1 answer
988 views

Swipe back gesture not working in iOS 17 when NavBar is hidden - Swift UI

I have been using the following extension in Swift UI to enable swipe back gestures even when the navigation bar is hidden. However, after updating to iOS 17 (beta), it seems that this code is no ...
0xAli's user avatar
  • 13
0 votes
2 answers
87 views

How to make a Line follow a CGPoint in SwiftUI?

I've created two CGPoints and a connecting line between them. My aim is the following: When I drag the second CGPoint with a SwiftUI DragGesture() the line will follow it (as if it's connected to it). ...
Kurt's user avatar
  • 71
0 votes
1 answer
84 views

Using hittest and UIGestureRecognizer to determine which view to use

I have a UIImageView above a MapView. I am currently able to draw lines on the UIImageView which is why i have TouchesBegan, TouchesMoved & TouchesEnded attached to it. When i pinch however, i ...
Redstain's user avatar
  • 167
0 votes
0 answers
16 views

how can I make the sibling views response their gesture togegher?

- (void)viewDidLoad { [super viewDidLoad]; self.scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:self.scrollView]; self.tableView = [[...
DolphinQuan's user avatar
0 votes
1 answer
27 views

UIPanGesture not working to change brightness on iOS 16.0+

I am using UIPanGesture to control the system brightness. Till now it was working well on iOS 15 to the previous version. But on iOS 16 the value only changes for one step. Here is my code @objc ...
Nibir's user avatar
  • 1
0 votes
2 answers
68 views

Coordinated Scrolling Between Two TableViews

I've got two overlapping UITableViews with only vertical scrolling. I want specialized coordinated scrolling across the two tables. I took the front table (in the view layering) and set ...
DBD's user avatar
  • 23.1k
0 votes
0 answers
35 views

have pinch gesture and pan gesture, how can I limit the pan gesture

I am writing a function like the goodnotes pinch gesture and pan gesture.but I don't know how to limit the pan gesture. I am having Pinch gesture I my code so if I zoom my photo it will messy my ...
jacky wang's user avatar
0 votes
0 answers
38 views

Temporarily disabling gestures in Swift

I have a PDFView which in itself has quite a lot of gestures already. In that PDFView is an Image. I added a PanGesture so I can drag it around. It got mixed up with the scrolling of the PDF Page ...
Simon Lemcke's user avatar
1 vote
1 answer
141 views

Adding gestures to ALL Model Entities in one Reality Composer scene, not just one?

So I asked a different question before, and arrived at a partial solution. I was able to add gestures to ONE of the two model entities on one scene, but not the other. Because when you print the scene,...
justCubesAndText's user avatar
0 votes
0 answers
58 views

Is there a way to add a Gesture inside .onAppear() in SwiftUI?

I have a tricky problem and I hope someone can help me out here: I have a container that shows a PDF and I add an Annotation to that PDF. So far so good. Now I need that Annotation to be draggable. ...
Simon Lemcke's user avatar
0 votes
1 answer
25 views

CollectionView doesn't scrolling through UIControl?

I have buttons inherited from UIControl in the horizontal UICollectionView. I want to add a behavior so that even when we do horizontal scrolling through buttons, my buttons don't catch touching, and ...
Anton Timonin's user avatar
2 votes
0 answers
620 views

How to detect 2 finger pan gesture in SwiftUI?

I'm trying to implement a view of an image with zoom and pan. Below is code from another question, it kinda works but I need the pan to happen for a 2 finger pan not a single finger. Is this possible? ...
erotsppa's user avatar
  • 14.5k
-1 votes
1 answer
67 views

Prevent touches from being passed to views underneath

I have a UIScrollView with a lot of touch handling. I override methods like touchesBegan, touchesMoved, etc. And inside that scroll view, I also have some other views with UIPanGestureRecognizer. The ...
Son Nguyen's user avatar
  • 1,214
1 vote
0 answers
458 views

ScrollView inside material top tabs navigation

I have this material top tabs navigation in react native : <Tab.Navigator initialRouteName="Screen1" screenOptions={() => ({ swipeEnabled: true, })}> ...
dudi ftw's user avatar
0 votes
0 answers
38 views

Do I need to call super in custom gesture recognizer’s reset / touchesCancelled

I created a custom gesture recognizer to handle collection of each touch events during a pan gesture, using Swift. I’m wondering if I need to call super in touchesCancelled and reset()? What would ...
Morris's user avatar
  • 1
0 votes
0 answers
86 views

How to pass through only vertical pan touches on top view to view underneath

There are a number of other S/O questions that discuss passing touches through a view on top to the view underneath. This is achievable by overriding the hitTest(_:with:) and/or point(inside:with:) ...
willbattel's user avatar
  • 1,100
4 votes
1 answer
3k views

"System gesture gate timed" out with UILongPressGestureRecognizer

I have a main view controller (UICollectionViewController) and the cells consist of a UIImageView, a UILabel and a UITableView. Something like this +----------------------------------------------------...
D. Mika's user avatar
  • 2,607
0 votes
1 answer
43 views

UITextView scrolling without triggering UIPageViewControllerDataSource in UIPageViewController's view controllers

I have multiple view controllers. Something like this: ViewControllerA ViewControllerB ViewControllerC I use these as my UIPageViewController's view controllers, (as pages). Each one of them has ...
incelemeTRe's user avatar
0 votes
0 answers
141 views

UIKit pinch gesture in a mixed SwiftUI / UIKit environment presents issues with scaleEffect, anchor and offset

Apple provides some elegant code for managing pinch gestures in a UIKit environment, this can be downloaded directly from Apple. In this sample code you will see three coloured rectangles that can ...
Juan's user avatar
  • 140
0 votes
1 answer
177 views

UITapGestureRecognizer not triggered when used by 2 overlapping UIViewRepresentable

Because I need to know whether user taps with finger or pencil, I had to create a UIViewRepresentable with a UITapGestureRecognizer. Everything works fine when this View is used with other SwiftUI ...
MohG's user avatar
  • 351
1 vote
0 answers
65 views

SwiftUI tapGesture not accurately counting

This simple code snippet recognizes a single tap gesture, and a triple tap gesture, but not a double tap gesture. Any idea why? var body: some View { VStack { Image(systemName: "globe&...
coco's user avatar
  • 3,008
0 votes
1 answer
80 views

Make buttons positioned on the right of the view after rotation or pinch in swift

Image editing app. It can zoom the image with pinchGesture, rotate it with rotateGesture and drag from corners to adjust image size. The image has 2 buttons near it. A rotate button - this one ...
Stefan's user avatar
  • 35
0 votes
0 answers
28 views

UIPanGestureRecognizer in Texture/AsyncDisplayKit's ASCellNode prevents the table from scrolling

I am using the Texture/AsyncDisplayKit library: https://github.com/texturegroup/texture I am trying to implement "swipe to perform action" in a ASCellNode. The problem is that the ...
sudoExclaimationExclaimation's user avatar
46 votes
1 answer
15k views

Why am I getting this: [SystemGestureGate] <0x102210320> Gesture: System gesture gate timed out

My iOS Swift 5 (Xcode 14.1) app is humming along. After the last Xcode update, I noticed that when I push a particular view controller with a table view inside a stack, inside a navigation controller, ...
flyer's user avatar
  • 471
1 vote
1 answer
318 views

Use pan gestures to rotate view in one corner swift

I'm trying to add a swiping future to a view, but I want it to move by moving the finger tip on it, around a corner of the view and when it reach a certain point, it stop moving. I did it with ...
Martin Lahn's user avatar
0 votes
1 answer
38 views

iOS Swift - How many UILongPressGestureRecognizers can be enabled at one time?

I have a simple synthesizer application that has 28 buttons (UIView's), and each one has a UILongPressGestureRecognizer attached to it. The .minimumPressDuration for each recognizer is set to 0, so ...
Evan Escobar's user avatar
0 votes
2 answers
174 views

Interactive push view controller

I am looking to have an interactive push view controller. So if the user pans from the right edge of the screen, it will pop to the next view controller. I have found this CocoaPods: https://github....
A5omic's user avatar
  • 75
0 votes
1 answer
71 views

View blocked from moving after being rotated

I implemented touchesMoved method for moving my view around and RotationGestureRecognizer to rotate it. It works normal, I can move and rotate my view. The problem is that the view after being rotated ...
user avatar
0 votes
2 answers
202 views

How can I swipe back to my First View Controller

Let say I have 3 View Controllers VC1, VC2 and VC3. The first View Controller is VC1, from this i'll go to VC2 and from VC2 i'll go to VC3. The question is how can I back from VC3 -> VC1 not VC3 -&...
Rilwanul Huda's user avatar
1 vote
1 answer
898 views

How to animate a shape (or button) as long as it's touched in SwiftUI?

I want a circle to slowly scale down as long as the user keeps a finger on it. The scale should stop and reset to its default value of 1 when either a LongPressGesture is detected (finished), i.e. ...
Mischa's user avatar
  • 16.1k
0 votes
1 answer
263 views

make a lot actions when long swipe SWIFT

i have a left and right Gestore recognizer and i need to do a lot of the same actions when user swipes. Like user touched screen and swiped a millimeter !ACTION, 1 more milimeter !ACTION, 1 more !...
Vadim's user avatar
  • 11
2 votes
2 answers
624 views

How to make flutter Google Maps scrollable only with two fingers in SingleChildScrollView

I have gestureRecognizers parameter set like this: child: GoogleMap( initialCameraPosition: widget.cameraPosition!, gestureRecognizers: <Factory<...
Karol Wiśniewski's user avatar
1 vote
0 answers
33 views

state .cancelled called automatic while pinching - swift

Im doing pinch gesture in a Image to scale the image , but while I'm pinching the image it first calls .began then sometimes .changed and finally .cancelled . I dont understand how the .cancelled ...
Mighty BOYKA's user avatar
1 vote
1 answer
39 views

How do I move other objects when I use GestureRecognizer?

I created a view with buttons and added the ability to move them using UIGestureRecognizer. I would like that when I start moving some buttons, the other buttons start moving as well, just like when I ...
Codl's user avatar
  • 52
0 votes
1 answer
174 views

configure tap gesture recognizer to also respond to ibactions at the tap location

I have a message chat box similar to most chat apps. The box goes up when when you start editing the messagetextView. As is standard, there is a tap gesture recognizer that is called when the user ...
Tim Hirsch's user avatar
0 votes
1 answer
352 views

Xamarin - Frame.GestureRecognizers doesn't work when tapped

I have a Xamarin project with a view of a product's details. I have two buttons which can increase or decrease the quantity of the product. To show how it changes I have a label named lblQuantity ...
robluc's user avatar
  • 121
0 votes
1 answer
101 views

How would I make a UiPanGestureRecognizer check if the finger is in the buttons frame?

I am trying to make an app where the user could drag a finger on top of multiple buttons and get some actions for each button. There was a similar question from a while back but when I tried to use ...
Kristoffer Melen's user avatar
0 votes
0 answers
78 views

How to improve magnification and rotation gesture recogniser methods in Objective-C?

I'm playing with NSGestureRecognizer(s) in Objective-C. I have a simple Custom View in the XIB canvas to which I applied the press, pan, magnify, and rotate gesture recognisers. From each one I have ...
NotationMaster's user avatar
0 votes
1 answer
50 views

How to show a done button depending on the edition status of a tableview, from a UITableView extension?

I wrote a UITableView extension that would allow the reordering of cells after holding the tableview. So the tableView goes edit mode as expected but what I would like to do is to add a Done button in ...
Abv's user avatar
  • 394
0 votes
1 answer
45 views

Glitching When Swift UIView is Dragged

I have a view in an iOS project that is meant to be dragged within the main view. The view. I've attached a pan gesture to that view (paletteView), and moving it around works fine. But, the "...
Dan Donaldson's user avatar
0 votes
1 answer
67 views

why the "shouldReceiveTouch" returns "NO", the "PanGesture" still works?

Such as title, I have a superView A and a childView B. The A has a panGestureRecognizer. When I swipe the B, it will trigger the panGestureRecognizer of A. So I return No in the shouldReceiveTouch of ...
Grayson's user avatar
  • 27
0 votes
0 answers
128 views

Image moving while rotating

I just move sticker after rotate, but the direction of the moved sticker is changed as much as the rotation angle and moves please help me, i don't know why this happen panGesture: UIView *gestureView ...
Sang Won Yu's user avatar
1 vote
0 answers
200 views

Swift: Other gestures are blocking default iOS 13 modal drag to dismiss gesture

I am modally presenting a complex view that itself has a number of gestures implemented. The entire experience was built in SwiftUI (although the modal is presented via UIKit). Anyway, I would like ...
RyJ's user avatar
  • 4,005
2 votes
0 answers
563 views

Can't detect gestures on google map

I want to detect user gestures on google map. I am using following code to do that. But I am not getting any detection. Can anyone provide some help on why I am not getting any detection. SafeArea( ...
Janaka's user avatar
  • 2,545
2 votes
1 answer
88 views

swift get position of finger when is pressed longer

I have a scrollview and would like to get the exact position of the finger when the user presses the screen longer. Or if that's possible just get the position of the finger in a scrollview when the ...
Fabian Müller's user avatar

1
2 3 4 5
73