Latest 2.1.4
Homepage https://github.com/JuanjoArreola/AsyncRequest
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0, requires ARC
Authors

Cocoapods
Platform
License
codebeat badge

Useful classes to handle asynchronous code

A Request is an object containing closures that can be called asynchronously at some point in the future:

let request = Request<String>(successHandler: { string in
    print(string)
})

Depending on the result of some computation the request can be successful:

request.complete(with: "Success!")

Or not:

request.complete(with: TestError.error)

In any case the request finishes:

request.finished {
    print("did finish")
}

Requests can be canceled:

request.cancel()

Closures can be added:

request.success(handler: { string in
    print("Result: (string)")
})

request.fail { error in
    print("Error: (error)")
}

request.finished {
    print("request did complete")
})

Latest podspec

{
    "name": "AsyncRequest",
    "version": "2.1.4",
    "summary": "Useful classes to handle asynchronous code",
    "homepage": "https://github.com/JuanjoArreola/AsyncRequest",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Juanjo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "source": {
        "git": "https://github.com/JuanjoArreola/AsyncRequest.git",
        "tag": "2.1.4"
    },
    "source_files": "Sources/*.swift",
    "requires_arc": true
}

Pin It on Pinterest

Share This