Skip to content
Snippets Groups Projects
Select Git revision
  • 448059c5bd23615cd3751c7c2228ff0010847dee
  • main default protected
  • dev protected
  • hotfixes-oct-2022
  • refactor/avatar-cell
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1
  • 1.0.8
  • 1.0.7
  • 1.0.6
12 results

Navigator.swift

Blame
  • Navigator.swift 797 B
    /// Navigator that performs a navigation action
    public protocol Navigator {
      /// Returns true if the navigator can perform the action
      /// - Default implementation returns true for any action
      /// - Parameter action: navigation action
      func canPerform(_ action: Action) -> Bool
    
      /// Performs the navigation action
      /// - Parameters:
      ///   - action: navigation action
      ///   - completion: closure that will be executed after performing the action
      func perform(_ action: Action, completion: @escaping () -> Void)
    }
    
    public extension Navigator {
      func canPerform(_ action: Action) -> Bool { true }
    
      /// Performs the navigation action with empty completion closure
      /// - Parameter action: navigation action
      func perform(_ action: Action) {
        perform(action, completion: {})
      }
    }