uipangesturerecognizer

Update constraints with UIPanGestureRecognizer

空扰寡人 提交于 2019-12-11 04:34:45
问题 I have a black separatorView in the middle of the screen separating a topContainerView (orange) and a bottomContainerView (green). The separatorView can be dragged up and down with a panGesture, but I can't get the top and bottom views to update their constraints and resize. The bottom of the orange view and the top of the green view should always stick with the separatorView. Here's the code I have (UPDATED to include variable declarations): let separatorView: UIView = { let view = UIView()

[ViewController gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]: message sent to deallocated instance

对着背影说爱祢 提交于 2019-12-11 03:02:48
问题 I have a simple scenario. I push myViewController onto navigation stack. myViewController is basically showing a collection view over entire screen. I added an additional UIPanGestureRecognizer on this collection view and set myViewController as its delegate. I am retaining a strong reference to that pan gesture recognizer inside myViewController . When I tap Back, myViewController gets popped from the navigation stack and deallocated. The myViewController 's dealloc method gets called as it

How do I determine the direction (up or down) of a UIPanGesture?

☆樱花仙子☆ 提交于 2019-12-11 02:12:40
问题 My goal is to set the iPhone's brightness with up or down pan gestures. If there is a simple way to determine the pan's direction, I can't figure it out. I added a swipe gesture recognizer, then the following code: - (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { return YES; } but my pan: method never seems to be able to determine the direction of the pan. I've set "self" as

UIPanGestureRecognizer is not working in iOS 13

依然范特西╮ 提交于 2019-12-10 19:06:47
问题 We have developed an app in iOS 12 which worked really fine. Now in iOS 13 UIPanGestureRecognizer is not working any more. I've search for solutions but didn't find anything. @IBAction func handlePan(recognizer:UIPanGestureRecognizer) { let translation = recognizer.translation(in: self.view) if let view = recognizer.view { let center = view.frame.origin.y + view.bounds.height / 2 if(center <= SliderView.bounds.height && center >= SliderView.bounds.minY) { view.center = CGPoint(x:view.center.x

Gestures Conflict on UITableView swipe to delete iOS

浪子不回头ぞ 提交于 2019-12-10 17:05:24
问题 I have a problem in my gesture recognizers. My goal is to implement using swipe to delete in my table view. But I think other gestures are conflicting with each other. I'm using this libray romaonthego/REFrostedViewController this a library for my hamburger menu and this library has a pangesture feature. I think the conflict is w/in the gestures. because when I run my code of my tableview in another project it's working.Pls help, Thank you in advance. 回答1: I had a similar problem, what I

Capture only UIView 2 finger UIPanGestureRecognizer

橙三吉。 提交于 2019-12-10 12:56:28
问题 I have a couple of UIScrollView s 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 detected. I tried overwriting the pointInside: method to return NO but then it doesn't record my 2 finger swipe. The effect is similar to the 4 finger swipe to change apps. 回答1: You don't

Can we add single gesture on multiple views and make it working? [duplicate]

廉价感情. 提交于 2019-12-10 11:13:52
问题 This question already has answers here : Can you attach a UIGestureRecognizer to multiple views? (11 answers) Closed 4 years ago . I am working on a sample of Pan Gesture. I am keen to know that can I add single gesture on two views? My code is as follows: UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(invokePanGesture:)]; [panGesture setMinimumNumberOfTouches:1]; [panGesture setMaximumNumberOfTouches:2]; [btnGreen

How to allow drag UIView (PanGesture..) just in some area

吃可爱长大的小学妹 提交于 2019-12-10 10:29:32
问题 I need drag UIView via PanGestureRecognizer (I know how to do), but I can't figure out, how to make it with limitation. Need some padding from top and also if there is collision with one of four sides (left, right, top (here is the padding) and bottom of device) stop the drag and you can't over - or 1px padding like on the top, whatever. :) I tried this one: https://github.com/andreamazz/UIView-draggable but if I set the area with limitation via cagingArea, iPad (Air) is lagged. Also the

Drag a UIView part-way, then it moves on its own

核能气质少年 提交于 2019-12-09 13:35:10
问题 I have an app with a draggable UIView placed at the bottom. The draggable view isnt totally offscreen and it has a "pull tab" that the user can drag upwards or downwards. Dragging up and down currently works, but I would like to give it the same behavior as the Apple notifications slide out drawer. For example, if I drag the view out 50% upwards and remove my finger from the screen, then I'd like the draggable view to continue to move upwards on its own. Likewise, if the user only dragged the

Hand off parent container's pan gesture to nested UICollectionView

主宰稳场 提交于 2019-12-09 12:58:12
问题 I'm trying to build a complex split view container controller that facilitates two variable height containers, each with their own nested view controller. There's a global pan gesture on the parent controller that allows the user to drag anywhere in the view container and slide the "divider" between views up and down. It also has some intelligent position threshold detection logic that will expand either view (or reset the divider position): This works fine. There's also a lot of code to