Questions tagged uipangesturerecognizer

Explore the latest questions and answers asked by our top developers.

Drag to dismiss a UIPresentationController

I have made a UIPresentationController that fits any view controller and shows up on half of the screen using this tutorial. Now I would love to add drag to dismiss to this. I’m trying to have the drag feel natural and responsive like the drag experience for "Top Stories" on the Apple iOS 13 stocks […]

UIView pan Gesture conflict with system gesture

I am installing a UIPanGestureRecognizer on the main view as follows: panGesture = UIPanGestureRecognizer(target: self, action: #selector(previewPanned(_:)) panGesture?.minimumNumberOfTouches = 1 panGesture?.maximumNumberOfTouches = 1 view.addGestureRecognizer(panGesture!) The problem is it gets simultaneously recognised with the system swipe gesture on home indicator to dismiss the app. How do I avoid this conflict? EDIT: The problem arises when I […]

How to move imageview using uipangesture when constraints are already applied to textfield

My swift code below applies 2 contraints to allow a textfield (enterText) to enter text and reamin in the same position it was moved too. I want to be able to move around the imageview pic around using uipangesture. However I can not do that because of the 2 constraints already applied to pic. So […]

Entering text into textfield causing uipangesture object to move back to its orginal position

My swift code below has a image view connected to a pangesture. When something is entered into a textfield when after the image view is moved. The image view reverts back to its original position.The gif represents that what is going on. I just don’t want the effect of the pangesutre to be nullified after […]

UIPanGestureRecognizer do something immediately when touched

I am new to ios, so I apologize in advance if I am missing something obvious. I am creating a puzzle where I would like the individual puzzle pieces to increase in size on touch and decrease on letting go. Currently I have: -(IBAction)handlePan:(UIPanGestureRecognizer *)recognizer{ if(recognizer.state == UIGestureRecognizerStateBegan) else if(recognizer.state == UIGestureRecognizerStateEnded) } The puzzle […]

By buczek
Published
Categorised as ios, uigesturerecognizer, uipangesturerecognizer

Swift – Hero animation to dismiss View

I am having trouble using the Hero Library to dismiss my ViewController with custom animation. In the end I would like to have pretty much the exact same animation as in this video: preferred dismiss animation So far my dismiss animation looks like this: my dismiss animation so far I am having 3 major problems […]

By Chris
Published
Categorised as animation, ios, swift, uipangesturerecognizer, uiviewcontroller

UIViewPropertyAnimator’s bounce effect

Let’s say I have an animator that moves a view from (0, 0) to (-120, 0): let frameAnimator = UIViewPropertyAnimator(duration: duration, dampingRatio: 0.8) animator.addAnimations { switch state: case .normal: view.frame.origin.x = 0 case .swiped: view.frame.origin.x = -120 } } I use it together with UIPanGestureRecognizer, so that I can resize the view continuously along with […]

Is it possible to do an edge swipe in iOS simulator?

iOS 7 provides for a UIScreenEdgePanGestureRecognizer which detects swipes in from edges of the screen. Can this gesture be simulated using the iOS7 simulator in Xcode? Clicking and dragging outside the screen area just moves the whole simulator frame around. Source: Ios7 Questions

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq