DBNetworkStack alternatives and similar libraries
Based on the "Networking" category.
Alternatively, view DBNetworkStack alternatives based on common mentions on social networks and blogs.
-
AFNetworking
A delightful networking framework for iOS, macOS, watchOS, and tvOS. -
CocoaAsyncSocket
Asynchronous socket networking library for Mac and iOS -
RestKit
RestKit is a framework for consuming and modeling RESTful web resources on iOS and OS X -
YTKNetwork
YTKNetwork is a high level request util based on AFNetworking. -
ASIHTTPRequest
Easy to use CFNetwork wrapper for HTTP requests, Objective-C, Mac OS X and iPhone -
Reachability.swift
Replacement for Apple's Reachability re-written in Swift with closures -
swift-protobuf
Plugin and runtime library for using protobuf with Swift -
apollo-ios
📱 A strongly-typed, caching GraphQL client for iOS, written in Swift. -
RealReachability
We need to observe the REAL reachability of network. That's what RealReachability do. -
Netfox
A lightweight, one line setup, iOS / OSX network debugging library! 🦊 -
MonkeyKing
MonkeyKing helps you to post messages to Chinese Social Networks. -
SwiftHTTP
Thin wrapper around NSURLSession in swift. Simplifies HTTP requests. -
Siesta
The civilized way to write REST API clients for iOS / macOS -
APIKit
Type-safe networking abstraction layer that associates request type with response type. -
ResponseDetective
Sherlock Holmes of the networking layer. :male_detective: -
NetworkEye
a iOS network debug library, monitor HTTP requests -
Networking
Easy HTTP Networking in Swift a NSURLSession wrapper with image caching support -
XMNetworking
A lightweight but powerful network library with simplified and expressive syntax based on AFNetworking. -
Pitaya
🏇 A Swift HTTP / HTTPS networking library just incidentally execute on machines -
SPTDataLoader
The HTTP library used by the Spotify iOS client -
Reach
A simple class to check for internet connection availability in Swift. -
SOAPEngine
This generic SOAP client allows you to access web services using a your iOS app, Mac OS X app and AppleTV app. -
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task -
TWRDownloadManager
A modern download manager based on NSURLSession to deal with asynchronous downloading, management and persistence of multiple files. -
TRON
Lightweight network abstraction layer, written on top of Alamofire -
Transporter
A tiny library makes uploading and downloading easier -
Malibu
:surfer: Malibu is a networking library built on promises -
ws ☁️
⚠️ Deprecated - (in favour of Networking) :cloud: Elegantly connect to a JSON api. (Alamofire + Promises + JSON Parsing) -
Restofire
Restofire is a protocol oriented networking client for Alamofire -
EVURLCache
a NSURLCache subclass for handling all web requests that use NSURLRequest -
AFNetworking+RetryPolicy
Nice category that adds the ability to set the retry interval, retry count and progressiveness. -
MultiPeer
📱📲 A wrapper for the MultipeerConnectivity framework for automatic offline data transmission between devices -
AFNetworking-Synchronous
Synchronous requests for AFNetworking 1.x, 2.x, and 3.x -
ROADFramework
ROAD – Rapid Objective-C Applications Development
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of DBNetworkStack or a related project?
README
DBNetworkStack
Main Features | |
---|---|
🛡 | Typed network resources |
🏠 | Value oriented architecture |
🔀 | Exchangeable implementations |
🚄 | Extendable API |
🎹 | Composable Features |
✅ | Fully unit tested |
📕 | Documented here |
The idea behind this project comes from this talk.objc.io article.
Basic Demo
Lets say you want to fetch a html
string.
First you have to create a service, by providing a network access. You can use URLSession out of the box or provide your own custom solution by implementing NetworkAccess
.
let networkAccess = URLSession(configuration: .default)
let networkService = BasicNetworkService(networkAccess: networkAccess)
Create a resource with a request to fetch your data.
let url = URL(staticString: "https://httpbin.org")
let request = URLRequest(path: "/", baseURL: url, HTTPMethod: .GET)
let resource = Resource(request: request, parse: { String(data: $0, encoding: .utf8) })
Request your resource and handle the result
networkService.request(resource, onCompletion: { htmlText in
print(htmlText)
}, onError: { error in
//Handle errors
})
Load types conforming to Swift-Decodable
struct IPOrigin: Decodable {
let origin: String
}
let url = URL(staticString: "https://www.httpbin.org")
let request = URLRequest(path: "ip", baseURL: url)
let resource = Resource<IPOrigin>(request: request, decoder: JSONDecoder())
networkService.request(resource, onCompletion: { origin in
print(origin)
}, onError: { error in
//Handle errors
})
Accessing HTTPResponse
Request your resource and handle the result & http response. This is similar to just requesting a resulting model.
networkService.request(resource, onCompletionWithResponse: { origin, response in
print(origin, response)
}, onError: { error in
//Handle errors
})
Protocol oriented architecture / Exchangability
The following table shows all the protocols and their default implementations.
Protocol | Default Implementation |
---|---|
NetworkAccess |
URLSession |
NetworkService |
BasicNetworkService |
NetworkTask |
URLSessionTask |
Composable Features
Class | Feature |
---|---|
RetryNetworkService |
Retrys requests after a given delay when an error meets given criteria. |
ModifyRequestNetworkService |
Modify matching requests. Can be used to add auth tokens or API Keys |
NetworkServiceMock |
Mocks a NetworkService. Can be use during unit tests |
Requirements
- iOS 9.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
- Xcode 10.2+
- Swift 5.0
Installation
Swift Package Manager
SPM is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
Specify the following in your Package.swift
:
.package(url: "https://github.com/dbsystel/DBNetworkStack", from: "2.0.0"),
Carthage
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
Specify the following in your Cartfile
:
github "dbsystel/dbnetworkstack" ~> 2.0
Contributing
Feel free to submit a pull request with new features, improvements on tests or documentation and bug fixes. Keep in mind that we welcome code that is well tested and documented.
Contact
Lukas Schmidt (Mail, @lightsprint09), Christian Himmelsbach (Mail)
License
DBNetworkStack is released under the MIT license. See LICENSE for details.
*Note that all licence references and agreements mentioned in the DBNetworkStack README section above
are relevant to that project's source code only.