Latest 1.0.1
Homepage https://github.com/kunwang/absnetwork
License MIT
Platforms ios 9.0
Dependencies Alamofire, ObjectMapper
Authors

absnetwork

A network foundation framework based on Alamorefire and ObjectMapper. This framework provide more sample and easy use interfaces and supports request retry, multi requests, generic response, pre request handlers and post response handlers configuration.

CocoaPods

pod 'ABSNetwork', '1.0.0'

Usage:

Normal use

ABSRequestSessionManager.shared.get("https://www.google.com", params: ["key":"value"], success:{[weak self](request,response) in 
    // do your work
}, fail: {[weak self](request,response) in 
    // do your work
})

Generic response use

ABSRequestSessionManager.shared.get("https://www.google.com", params: ["key":"value"], success:{[weak self](request,response:ABSGenericResponse<YourObjectMapperObject>) in 
    // do your work
}, fail: {[weak self](request,response) in 
    // do your work
})

Requestor use

let requestor = ABSRequestor(ABSRequest("https://www.google.com").params([["key":"value"]]).headers(["key":"value"])).delegate(completeHandlerDelegateInstance)
requestor.execute()

or

let requestor = ABSRequestor(ABSRequest("https://www.google.com").params([["key":"value"]]).headers(["key":"value"])).handler({[weak self](request,response) in 
    // do your work
}, fail: {[weak self](request,response) in 
    // do your work
})
requestor.execute()

Multi requestor all finish request

let requestor1 = ABSRequestor(ABSRequest("https://www.google.com").params([["key":"value"]]).headers(["key":"value"])).delegate(delegateInstance)
let requestor2 = ABSRequestor(ABSRequest("https://www.google.com").params([["key":"value"]]).headers(["key":"value"])).delegate(delegateInstance)
let requestorJoiner = ABSRequestorJoiner().join(requestor1).join(requestor2).delegate(requestorJoinerDelegateInstance)
requestorJoiner.execute()

And many usage

Latest podspec

{
    "name": "ABSNetwork",
    "version": "1.0.1",
    "summary": "A network foundation framework based on Alamorefire and ObjectMapper",
    "license": "MIT",
    "homepage": "https://github.com/kunwang/absnetwork",
    "authors": {
        "abstractwang": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/kunwang/absnetwork.git",
        "tag": "1.0.1"
    },
    "source_files": [
        "Sources",
        "ABSNetwork/**/*.{swift}"
    ],
    "resources": [
        "Resources",
        "ABSNetwork/**/*.{plist,sqlite3}"
    ],
    "dependencies": {
        "Alamofire": [
            "~> 4.5.1"
        ],
        "ObjectMapper": [
            "~> 2.2"
        ]
    },
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This