GithubHelp home page GithubHelp logo

Comments (4)

lkzhao avatar lkzhao commented on July 24, 2024

You can probably do something like this instead of setting isHeroEnabled.

extension ModalNavigationController: UINavigationControllerDelegate {
    func navigationController(_ navigationController: UINavigationController,
                              willShow viewController: UIViewController,
                              animated: Bool) {
        //need to configure something on viewController.view
    }

    func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return Hero.shared.navigationController(navigationController, animationControllerFor:operation, from:fromVC)
    }
  
    func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
        return Hero.shared.navigationController(navigationController, interactionControllerFor:animationController)
    }
}

from hero.

lkzhao avatar lkzhao commented on July 24, 2024

Hero.shared is not avaliable on cocoapods and carthage yet. The current master contains a major API change. Will wait a few day before releasing the next version. In the mean time, you can use

pod "Hero", :git => 'https://github.com/lkzhao/Hero.git'

from hero.

felix-dumit avatar felix-dumit commented on July 24, 2024

I had to add nav.transitioningDelegate = Hero.shared instead of setting isHeroEnabled.
It turns out those two delegate methods are not being called at all. (even with setting isHeroEnabled) - is that expected?
EDIT: Actually it get's called once I push from the rootVC to the next one, that makes sense.

from hero.

lkzhao avatar lkzhao commented on July 24, 2024

Oh. I guess I didn't understand your question clearly.

Yes, for the modal presentation you only have to set 'transitionDelegate'. Hero also sets the navigation controller's delegate for animating navigation controller's child view controllers. If you don't need that functionality then it is ok to just set the 'transitionDelegate'

from hero.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.