Latest 0.1.3
License MIT
Platforms ios 10.0
Dependencies SwiftyJSON, Alamofire


NetworkEngine will help you to make API call easily with out the overhead of writing tons of boilerplate codes. Currently it has dependency with two awesome frameworks SwiftyJSON and Alamofire, but in future we will re-write the engine in such a way that, there won’t be any hardcoded dependency.

Quick Start

In your [Podfile]:


target "Change Me!" do
  pod "NetworkMediator"

NetworkEngine support Xcode 8.3, 9.0, 9.1, 9.2 and 9.3; Swift 3.1,
3.2, 3.3, 4.0 and 4.1.

Getting Started

Create an Operation which is a subclass of JSONOperation and provide a ResponseModel which conform to Codable protocol.

public class StartWarsOperation: JSONOperation<StarWarsCharacterResponseModel> {
    public override init() {
        self.request = Request(method: .get, endpoint: "/people", params: nil, fields: nil, body: nil)

Response model will look like,

public struct StarWarsCharacterResponseModel:Codable {
    let next: String
    let characters: [JediProfile]

    private enum CodingKeys: String,CodingKey {
        case next
        case characters = "results"

Finaly, create a ServiceConfig and Service to make API call.

//You could configure your own service instance with different config setup.
let serviceConfig = ServiceConfig(name: "StarWars", base: "")
let service = Service(configuration: serviceConfig!)
StartWarsOperation().execute(in: service) { [weak self] (startWarsResponse, resultType) in
    self?.jdProfiles = startWarsResponse?.characters
    DispatchQueue.main.async {

For more details please check Example

Latest podspec

    "name": "NetworkMediator",
    "version": "0.1.3",
    "summary": "NetworkMediator will help you to make Api calls with out writing tons of boilerplate code.",
    "description": "NetworkMediator will help you to make Api calls with out writing tons of boilerplate code!.The current release has a dependency with Alamofire which will be removed in future so that you could add normal NSURLSession or any other dependency in the lowest abstarction.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Fahad C H": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.3"
    "platforms": {
        "ios": "10.0"
    "source_files": "NetworkEngine/*",
    "dependencies": {
        "SwiftyJSON": [],
        "Alamofire": []

Pin It on Pinterest

Share This