Latest 0.1.0
License MIT
Platforms ios 8.0, osx 10.10, watchos 2.0, tvos 9.0
Dependencies Alamofire, SwiftyJSON, HydraAsync
Frameworks Foundation

Carthage compatible CI Status Version License Platform

HermesNetwork is the concrete implementation of an isolated/testable networking layer written in Swift.

Architecture Design

Current version is based upon the network architecture design described in:
"Network Layers in Swift (Updated)" written by me.

Used Libraries

While the theory behind this approach is independent from the tool used, in order to give a complete out-of-box approach I’ve used the following libraries:

  • Networking support: in this example the Service implementation uses Alamofire. Switching to NSURLSession is pretty easy and, in fact, suggested.
  • Async/Promise support: I love promises (at least until we’ll get something better with Swift 5) because they are clean, simple and offer a strong error handling mechanism.
    Our networking layer uses Hydra, that recently hits the 1.0 milestone.
  • JSON: The higher level (near your app) of the architecture offer out-of-box JSON support with JSONOperation class: everything about JSON was offered by SwiftyJSON, probability the best library for these stuff.


You can install Swiftline using CocoaPods, carthage and Swift package manager


pod 'HermesNetwork'


github 'malcommac/HermesNetwork'

Swift Package Manager

Add swiftline as dependency in your Package.swift

import PackageDescription

let package = Package(name: "YourPackage",
dependencies: [
.Package(url: "", majorVersion: 0),

Latest podspec

    "name": "HermesNetwork",
    "version": "0.1.0",
    "summary": "Concrete Implementation of Isolated/Testable Network Layer in Swift",
    "description": "This project aims to show how to write an isolated and testable networking layer in Swift. Original article can be found in README file.'",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Daniele Margutti": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0",
        "osx": "10.10",
        "watchos": "2.0",
        "tvos": "9.0"
    "source": {
        "git": "",
        "tag": "0.1.0"
    "source_files": "Sources/**/*",
    "frameworks": "Foundation",
    "dependencies": {
        "Alamofire": [],
        "SwiftyJSON": [],
        "HydraAsync": []
    "pushed_with_swift_version": "3.2"

Pin It on Pinterest

Share This