Service

public class Service<N> where N : NetworkHandler

Service represents the service that holds all the network functionality, offers configuration to the filter and sort query creation and stores the RESTful service address to perform the network requests

  • With the init of the Service, a user specifies the RESTful service addressed through a URL. The NetworkHandleris used for the network communication. The user has the possibility to set a global filter or sort strategy on the server-side with specifying a function for the translation of the strategy to a URLQueryItem.

    Declaration

    Swift

    public init(url: URL,
                networkHandler: N,
                filterServerStrategy: ((String, String, String) -> URLQueryItem)? = nil,
                sortServerStrategy: ((String, String) -> URLQueryItem)? = nil)