Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malcommac/HermesNetwork
https://github.com/malcommac/HermesNetwork
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/malcommac/HermesNetwork
- Owner: malcommac
- License: mit
- Archived: true
- Created: 2017-09-10T15:33:34.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-29T13:57:49.000Z (about 6 years ago)
- Last Synced: 2024-07-27T15:39:26.321Z (about 2 months ago)
- Language: Swift
- Size: 57.6 KB
- Stars: 72
- Watchers: 10
- Forks: 20
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HermesNetwork
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![CI Status](https://travis-ci.org/malcommac/HermesNetwork.svg)](https://travis-ci.org/malcommac/HermesNetwork) [![Version](https://img.shields.io/cocoapods/v/HermesNetwork.svg?style=flat)](http://cocoadocs.org/docsets/HermesNetwork) [![License](https://img.shields.io/cocoapods/l/HermesNetwork.svg?style=flat)](http://cocoadocs.org/docsets/HermesNetwork) [![Platform](https://img.shields.io/cocoapods/p/HermesNetwork.svg?style=flat)](http://cocoadocs.org/docsets/HermesNetwork)
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)**"](http://danielemargutti.com/2017/09/09/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](https://github.com/Alamofire/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](https://github.com/malcommac/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](https://github.com/SwiftyJSON/SwiftyJSON), probability the best library for these stuff.## Installation
You can install Swiftline using CocoaPods, carthage and Swift package manager### CocoaPods
```
use_frameworks!
pod 'HermesNetwork'
```### Carthage
```
github 'malcommac/HermesNetwork'
```### Swift Package Manager
Add swiftline as dependency in your `Package.swift````
import PackageDescriptionlet package = Package(name: "YourPackage",
dependencies: [
.Package(url: "https://github.com/malcommac/HermesNetwork.git", majorVersion: 0),
]
)
```