Hero: Freezing screen after navigating back and forth between screens

I create transaction from tableView to ViewController with animation some images from cell to view. After fore of five transactions to and back, transaction freezing. It’s look like viewcontroller dismissed but snapshot view still showing. I guess my view controller closed before animation is completed. Usually I close viewcontoller self.dismiss(animated: true, completion: nil)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 9
  • Comments: 16

Most upvoted comments

Calling finish and cancel like this solved the problem for me:

extension HeroTransition {
    func cancelOnMain(animate: Bool = true) {
        DispatchQueue.main.async {
            Hero.shared.cancel(animate: animate)
        }
    }
    
    func finishOnMain(animate: Bool = true) {
        DispatchQueue.main.async {
            Hero.shared.finish(animate: animate)
        }
    }
}

I was already calling them on the main thread (tested) so it must have been this async that helped…

i faced Same issue @Maxim-Zakopaylov did you find any solution?

screenshot 2019-01-29 at 3 53 58 pm i close Controller using hero.dismissViewController()