Latest 0.3.0
Homepage https://github.com/halcyonmobile/RestBird
License MIT
Platforms ios 9.0, osx 10.10

RestBird 🦉

Codacy Badge
Build Status
codecov

Lightweight, stateless REST network manager over the Codable protocol.

About

Requirements

  • iOS 9.0+ / macOS 10.11+
  • XCode 10.0+
  • Swift 4.2+

Features

  • [x] Codable support.
  • [x] Built-in Alamofire driver.
  • [ ] Built-in URLSession driver.

Installation Instructions

Swift Package Manager

Add RestBird as a dependency to your project.

.Package(url: "https://github.com/halcyonmobile/RestBird.git", majorVersion: 0, minorVersion: 3)

You can use RestBird and implement your own session handling or use one of the built-in drivers implemented by RestBird (Alamofire and URLSession).

// Use RestBird without any driver
targets: [
    Target(name: "YourTarget", dependencies: ["RestBird"])
]

// Use the URLSession Driver
targets: [
    Target(name: "YourTarget", dependencies: [
        .product(name: "RestBird-URLSession", package: "RestBird")
    ])
]

// Use the Alamofire Driver
targets: [
    Target(name: "YourTarget", dependencies: [
        .product(name: "RestBird-Alamofire", package: "RestBird")
    ])
]

CocoaPods

# use RestBird without any driver
pod 'RestBird'

# use RestBird with Alamofire driver
pod 'RestBird/Alamofire'

You can also try it out by running

pod try RestBird

Carthage

github "halcyonmobile/RestBird"

Setup

Steps for setting up the project for development:

  • Clone the repo
  • Generate Xcode project by executing swift package generate-xcodeproj
  • Open project

Usage

First you need to create your NetworkClientConfiguration configuration with your custom or one of the provided session manager drivers. We’re going to use the AlamofireSessionManager.

struct MainAPIConfiguration: NetworkClientConfiguration {
    let baseUrl = "https://api.example.com"
    let sessionManager = AlamofireSessionManager()
}

Now we can pass this configuration to the network client.

let networkClient = NetworkClient(configuration: MainAPIConfiguration())

License

RestBird is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "RestBird",
    "version": "0.3.0",
    "homepage": "https://github.com/halcyonmobile/RestBird",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": "Halcyon Mobile",
    "summary": "Lightweight, stateless REST network manager over the Codable protocol.",
    "swift_version": "4.2",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10"
    },
    "source": {
        "git": "https://github.com/halcyonmobile/RestBird.git",
        "tag": "v0.3.0"
    },
    "default_subspecs": "Core",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "Sources/RestBird/**/*.swift"
        },
        {
            "name": "Alamofire",
            "source_files": "Sources/RestBird-Alamofire/*.swift",
            "dependencies": {
                "RestBird/Core": [],
                "Alamofire": []
            }
        },
        {
            "name": "URLSession",
            "source_files": "Sources/RestBird-URLSession/*.swift",
            "dependencies": {
                "RestBird/Core": []
            }
        }
    ]
}

Pin It on Pinterest

Share This