ElasticTransition icon indicating copy to clipboard operation
ElasticTransition copied to clipboard

Dragging View issue

Open marcelocotrim opened this issue 7 years ago • 13 comments

Sometimes when dragging a view (presenting and dismissing), the app "freezes" and we can't navigate to other views.

marcelocotrim avatar Jul 23 '16 14:07 marcelocotrim

The same problem I had meet. It happened when dragging fast from edge in you demo. It "freezes" cause of the view above the windows like the image attached: Could you help to fix it! Thanks a lot😃 wechatimg2

delphi-2015 avatar Aug 27 '16 15:08 delphi-2015

I am having this exact same issue. Since this issue makes the library almost useless (it happens like 1 out of 3 times), would it be possible to fix this issue? I'd love to dig into the code and fix it myself, but I have no clue where to look..

Thanks a lot for the awesome library though!

bramroelandts avatar Feb 05 '17 08:02 bramroelandts

@brammahh Can you upload your project so I can checkout how you have implemented. I am not seeing this in the example project.

lkzhao avatar Feb 05 '17 16:02 lkzhao

Jurista.zip

In attachement, you can find my project. After clicking 'Start app', you can drag left and right for the menu's to appear. If you drag them fast enough one after the other, the app freezes from time to time.

Thanks in advance!

bramroelandts avatar Feb 05 '17 20:02 bramroelandts

I have the exact same problem as you. I can't seem to find a good way to reproduce it, but I happens often enough to make the app unsubmitable. Unfortunately I don't have a clue so any suggestions is highly appreciated.

JazzBallet avatar Feb 08 '17 19:02 JazzBallet

I will reimplement this lib as as Hero plugin once Hero supports overFullScreen presentation. That would help eliminate these bugs and make it support navigationController. For now I don't have a work around.

lkzhao avatar Feb 08 '17 19:02 lkzhao

@lkzhao cool, thank you for the swift reply. Unfortunately, I'm not skilled enough to give any valuable input. It's just too bad I really like this transition and build my app around, but might need to find something else.

JazzBallet avatar Feb 08 '17 20:02 JazzBallet

I found that was because the animation completion block not been called, if dragging too fast or too often, and then transition did no clean works. I add a timer to check it, but not a good idea.

anysome avatar May 16 '17 09:05 anysome

@lkzhao Any chance you can look into this again? This issue has been around for more than a year now.

mrdavidrees avatar Jul 31 '17 00:07 mrdavidrees

@lkzhao

If this helps I think i've identified the issue and the fix:

 override func cancelInteractiveTransition(){
    super.cancelInteractiveTransition()
    let finalPoint = self.finalPoint(!presenting)

    print("running cancel animation")
    lc.m_animate("center", to: finalPoint, stiffness: animationSideStiffness, damping: animationDamping, threshold: animationThreshold)
    cc.m_animate("center", to: finalPoint, stiffness: animationCenterStiffness, damping: animationDamping, threshold: animationThreshold){
      self.cc.center = finalPoint
      self.lc.center = finalPoint
      self.updateShape()
      self.clean(false)
      print("cancel animation ran") //not being called because it's already a the final point
    }
    
    if cc.center == finalPoint {
        print("already there")
        self.cc.center = finalPoint
        self.lc.center = finalPoint
        self.updateShape()
        self.clean(false)
    }
  }

mrdavidrees avatar Jul 31 '17 02:07 mrdavidrees

@mrdavidrees I used your code and totally worked! Thanks

MaisaMilena avatar Aug 24 '17 20:08 MaisaMilena

@lkzhao: Did you implement Elastic Transition is a part of Hero? I download it but no find Elastic mode in it. I download Elastic Transition and convert it to swift 5 and fix some bug but still some bug about wrong frame (navigation and safe area update after viewcontroller showed) when present viewcontroller type top and bottom, but left and right work perfect. transition.edge = .top transition.startingPoint = (sender as AnyObject).center performSegue(withIdentifier: topIdSegue, sender: self) And some time viewcontroller frezze because of TransitionView in top layer (I fixed it follow other post issuse) but sometime it still frezze. Sorry for my bad English.

QuyetND avatar Oct 24 '19 07:10 QuyetND

And some time viewcontroller frezze because of TransitionView in top layer (I fixed it follow other post issuse) but sometime it still frezze.

I agree

yunustek avatar Feb 22 '21 01:02 yunustek