TNRouter

public final class TNRouter<Route> where Route : TNRouteProtocol

This class is used to create instances of TNRouter that can be used to start requests based on the given Route.

Properties

  • Initialize with environment that overrides the one set by TNEnvironment.set(_).

    Declaration

    Swift

    public init(environment: TNEnvironmentProtocol? = nil,
                configuration: TNConfiguration? = nil)
  • Returns a TNRequest that can be used later, e.g. for starting the request in a later time or canceling it.

    Declaration

    Swift

    public func request(for route: Route) -> TNRequest

    Parameters

    route

    a TNRouteProtocol enum value