NavigatorDelegate.swift 782 B

1234567891011121314151617181920212223
  1. #if os(iOS) || os(tvOS)
  2. import UIKit
  3. public protocol NavigatorDelegate: class {
  4. /// Returns whether the navigator should push the view controller or not. It returns `true` for
  5. /// default.
  6. func shouldPush(viewController: UIViewController, from: UINavigationControllerType) -> Bool
  7. /// Returns whether the navigator should present the view controller or not. It returns `true`
  8. /// for default.
  9. func shouldPresent(viewController: UIViewController, from: UIViewControllerType) -> Bool
  10. }
  11. extension NavigatorDelegate {
  12. public func shouldPush(viewController: UIViewController, from: UINavigationControllerType) -> Bool {
  13. return true
  14. }
  15. public func shouldPresent(viewController: UIViewController, from: UIViewControllerType) -> Bool {
  16. return true
  17. }
  18. }
  19. #endif