Latest 0.3.0
Homepage https://github.com/ShengHuaWu/RequestController
License MIT
Platforms ios 10.0, requires ARC
Authors

Request Controller Carthage compatible

This project is a HTTP request component in Swift, and it’s inspired by Exploring MVC-N in Swift and Mock Classes You Don’t Own.

  • Current version supports Swift 3.

Usage

First thing is to import the RequestContoller framework.
Once imported, you’re able to create a request and then set up the response handler.

let url = URL(string: "https://developer.apple.com")!
let requestController = RequestContoller()
let request = requestContoller.request(url).response { result in
  do {
    let (response, data) = try result.unwrap()
    // Response handling
  } catch let error {
    // Error handling
  }
}
request.resume()

Installed by Carthage

Add the following line into your Cartfile,

  github "ShengHuaWu/RequestController"

, and then run carthage update --platform ios in your terminal.

Installed by CocoaPods

Create a Podfile as following,

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

pod 'RequestController'

, and then run pod install in your terminal.

Latest podspec

{
    "name": "RequestController",
    "version": "0.3.0",
    "summary": "Swift HTTP request component.",
    "description": "This project is a HTTP request component in Swift.",
    "homepage": "https://github.com/ShengHuaWu/RequestController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "ShengHua Wu": "[email protected]"
    },
    "social_media_url": "https://twitter.com/ShengHuaWu",
    "platforms": {
        "ios": "10.0"
    },
    "source": {
        "git": "https://github.com/ShengHuaWu/RequestController.git",
        "tag": "0.3.0"
    },
    "source_files": "RequestController/*.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This