Latest 0.1.3
License MIT
Platforms ios 8.0

Build Status Version License Platform


Provides a lightweight and simple NetworkClient to build and intiate URLRequests in Swift.


  • iOS 8.0 + / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.1+
  • Swift 3.0+


CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate SwiftNetworking into your Xcode project using Cocoapods, specify it in your Podfile:

source ''
platform :ios, '10.0'

target '<Your Target Name>' do
    pod 'SwiftNetworking'

Then, run the following command:

$ pod install


Creating a Request

Initialize a NetworkClient object with a baseURL. You may also include a custom session (defaults to URLSession.shared).

import SwiftNetworking

let baseURL = URL(string: "")!
let client = NetworkClient(baseURL: baseURL)
let request = client.buildRequest(method: .get, path: "me")

Initiating a request

let client = NetworkClient(baseURL: baseURL)
client.request(path: "me")

You may also provide a completion handler. An enum Result<Element> serves to contain the success and failure cases of a network request response.
The completion handler is of type (NetworkResult) -> Void, where NetworkResult is a typealias of Result<(URLResponse, Data?)>.

client.request(path: "me") { (result) in
    switch result {
    case .success(let response, let data):
        // Handle success
    case .failure(let error):
        // Handle failure


[email protected]


SwiftNetworking is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "SwiftNetworking",
    "version": "0.1.3",
    "summary": "A micro networking framework for Swift",
    "description": "SwiftNetworking provides a thin NetworkClient class that builds and executes URLRequests.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "[email protected]": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.3"
    "platforms": {
        "ios": "8.0"
    "source_files": "SwiftNetworking/Classes/**/*",
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This