NetworkService

public protocol NetworkService : AnyObject

To provide the functionality which actually handles the network calls

  • Associated API Endpoint

    Declaration

    Swift

    associatedtype Target : NetworkEndpoint
  • Session configuration can be set for this API

    Declaration

    Swift

    var config: URLSessionConfiguration? { get set }
  • actual method that handles the network call and relay the response back after parsing json

    Declaration

    Swift

    func fetch(_ target: Target, completion: @escaping (Data?, Error?) -> Void) -> URLSessionTask?