Skip to content

Commit

Permalink
Added previous delegate calls for UINavigationController (#430)
Browse files Browse the repository at this point in the history
* Added previous delegate calls for UINavigationController

* Revert cocoapods version
  • Loading branch information
bradphilips authored and lkzhao committed Apr 27, 2018
1 parent 7d61342 commit 0918c28
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
import UIKit

extension HeroTransition: UINavigationControllerDelegate {
public func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
if let previousNavigationDelegate = navigationController.previousNavigationDelegate {
previousNavigationDelegate.navigationController?(navigationController, willShow: viewController, animated: animated)
}
}

public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if let previousNavigationDelegate = navigationController.previousNavigationDelegate {
previousNavigationDelegate.navigationController?(navigationController, didShow: viewController, animated: animated)
}
}

public func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
guard !isTransitioning else { return nil }
self.state = .notified
Expand Down

0 comments on commit 0918c28

Please sign in to comment.