subviews

iOS >> Dragged View is Jumping Back to Original Position >> Auto Layout Combined with UIPanGestureRecognizer Issue

我的梦境 提交于 2019-11-27 20:14:11
I have several UIViews that the user should be able to drag & drop. I use UIPanGestureRecognizer to manage the d&d action (see code below). The d&d action is working fine, but when I start dragging another UIView, the one that I just dropped is jumping back to its original position. - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; switch (recognizer.state) { case UIGestureRecognizerStateBegan: for (UIView* checkView in dragAndDropImageViewsArray) { if (checkView == recognizer.view) { [checkView.superview

iOS >> Dragged View is Jumping Back to Original Position >> Auto Layout Combined with UIPanGestureRecognizer Issue

江枫思渺然 提交于 2019-11-26 20:14:48
问题 I have several UIViews that the user should be able to drag & drop. I use UIPanGestureRecognizer to manage the d&d action (see code below). The d&d action is working fine, but when I start dragging another UIView, the one that I just dropped is jumping back to its original position. - (void)handlePan:(UIPanGestureRecognizer *)recognizer { CGPoint translation = [recognizer translationInView:self.view]; switch (recognizer.state) { case UIGestureRecognizerStateBegan: for (UIView* checkView in