-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Custom NavigationController Delegate #25
Comments
You can probably do something like this instead of setting 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)
}
} |
|
I had to add |
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' |
I have a custom segue class that instantiates a
UINavigationController
class like this:In the
ModalNavigationController
viewDidLoad
I setdelegate = self
since I need to perform a custom action on:However, when I set
nav.isHeroEnabled
I see that the navigationController's delegate gets set toHero.shared
.Basically both need to be the delegate even though they need different method callbacks.
Do you have any ideas for solutions?
Maybe
Hero
could expose an extranavigationDelegate:UINavigationControllerDelegate
property that only replays the callbacks it receives (probaby worth doing for other delegates as well).The text was updated successfully, but these errors were encountered: