Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hero.shared.end() #90

Closed
Rozariozaro opened this issue Feb 13, 2017 · 11 comments
Closed

Hero.shared.end() #90

Rozariozaro opened this issue Feb 13, 2017 · 11 comments

Comments

@Rozariozaro
Copy link

Rozariozaro commented Feb 13, 2017

Sometimes Hero.shared.end() ends the transitions but does not update the views to the current progress so it gets stuck and no userinteraction is available to dismiss the viewcontroller.

I have also tried using Hero.shared.end(animate:true), It freezes the app.

@lkzhao
Copy link
Collaborator

lkzhao commented Feb 13, 2017

Can you give me more context? Is it in a navigation controller? Does it happen when user flicks very fast? One thing that might be causing this is that you called update(progress:) after you called end.

@Rozariozaro
Copy link
Author

Rozariozaro commented Feb 13, 2017

This is my handlePan method

`
Hero.shared.defaultAnimation = .fade

    let translation = panGR.translation(in: nil)
    let progress = -(translation.x / 2 / songImgVw.bounds.width)
    
    switch panGR.state {
    case .began:
        _ = navigationController?.popViewController(animated: true)
    case .changed:
        let imagePosition = CGPoint(x: translation.x + songImgVw.center.x, y: songImgVw.center.y)
        
        print(progress)
        Hero.shared.update(progress: Double(progress))
        Hero.shared.apply(modifiers: [.position(imagePosition)], to: songImgVw)
        
    default:
        if progress - panGR.velocity(in: nil).x / songImgVw.bounds.width > 0.3 {
            Hero.shared.update(progress: Double(progress))
            Hero.shared.end()
        } else {
            Hero.shared.cancel()
        }
        
    }

`
It is in a navigationController. I am pushing to the current viewController with collectionView didSelect method.

I have included a modifier of [.beginWithIfMatched(modifiers: [.zPosition(3)]), .arc] for the image to transition from viewcontrollers..

It happens only for some instances the total app freezes.

@lkzhao
Copy link
Collaborator

lkzhao commented Feb 13, 2017

Thanks, I know whats happening if it is in a UINavigationController. I have seen this before. One more question, are you on the latest version? I remember trying to fix it a few commits back. But I am not sure if that fix was successful since it is hard to reproduce.

@Rozariozaro
Copy link
Author

Yeah I am on the latest source file downloaded from github.

@lkzhao
Copy link
Collaborator

lkzhao commented Feb 13, 2017 via email

@lkzhao
Copy link
Collaborator

lkzhao commented Feb 13, 2017

@Rozariozaro Can you try again with the latest master?

@Rozariozaro
Copy link
Author

Rozariozaro commented Feb 14, 2017

Yeah now it is working fine.. Thank you for solving this issue so swiftly.. Thumbs up..

@leeprobert
Copy link

Can you give us some more information about the fix for this? I am seeing the same thing. I have an interactive transition between view controllers, and sometimes the app just seems to freeze. It is like the transition has not ended and given back control.

@hiroshihorie
Copy link

I am having the same issue too.

@cnluocj
Copy link

cnluocj commented Jan 16, 2018

emmmmm, I am having the same issue too.

@StainlessStlRat
Copy link

I am experiencing this issue but it is fully re-creatable for me.

I have a collection view with images, when selected I unmark the previous heroID, and set the ID to the image that was clicked. I then push to a DetailViewController that inherits from tableView.

I have a gesture recognizer attached to this view so that I can still swipe back. I had to set the delegate of that recognizer to work simultaneously with the tableView's scroll gesture recognizer or else it wouldn't scroll.

If I scroll that view and then hit the "back" button, it freezes. Every time.
If I scroll that view and slide left a little, starting the transition some, and let it slide back and THEN hit the back button, it works just fine.
If I go to the detail view controller and don't scroll, it never freezes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants