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 theService
, a user specifies the RESTful service addressed through aURL
. TheNetworkHandler
is 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 aURLQueryItem
.Declaration
Swift
public init(url: URL, networkHandler: N, filterServerStrategy: ((String, String, String) -> URLQueryItem)? = nil, sortServerStrategy: ((String, String) -> URLQueryItem)? = nil)