Skip to content

AbdelrhmanKamalEliwa/APIServiceComponent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

APIServiceComponent 🚀

A powerful, scalable, and clean Network-Layer for Swift.

Features

  • APIServiceContract: it's a protocol that has a func request() implemeted by the APIService class.
  • APIService: it's a singletion class that implements the APIServiceContract protocol to use func request(), this func take the URLRequest and make the request then return a completionHandler of type APIResult
  • APIBuilder: it's a builder class that builds the URLRequest to send it to the APIService class to make the request.
  • APIResult: it's an enum type that has two cases, success of type Genereic, and error of type APIError.
  • APIError: it's an enum type that has many custom types of errors like: decodingFailure, requestTimeOut, requestError, unexpected, and etc.
  • NetworkConstants: it's a constant file that contains the constants helps the APIServiceComponent like: BaseURL, timeoutIntervalForRequest, serviceQueue, and etc.
  • APIEndPoints: it's an enum type that contains the end points that used to build the URLRequest.
  • HTTPMethod: it's an enum type that contains all HTTP Methods that used to build the URLRequest.
  • HTTPHeader: it's a constant file that contains the constants of the request Header.
  • ContentType: it's a constant file that contains the constants of the Content Type.
  • RequestParameters: it's an enum type that has two cases body(_: Parameters), and query(_: Parameters), to set neither body or query parameters to the request. Parameters is a typealias for the Dictionary type [String: Any].

Architecture

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages