Latest 0.1.2
Homepage https://github.com/alexiscn/GenericNetworking
License MIT
Platforms ios 8.0
Dependencies Alamofire
Authors

CI Status
Version
License
Platform

Features

  • [x] GET / POST Methods
  • [ ] Upload data

Example

To run the example project, clone the repo, and run pod install from the Example directory first.


class GithubSDK {
    public static func getGists(completion: @escaping GenericNetworkingCompletion<[Gist]>) {
    // response is array of objects
        GenericNetworking.requestJSON(baseURLString: "https://api.github.com", path: "/gists", method: .get, parameters: nil, headers: nil, completion: completion);
    }

    public static func getGistDetail(_ gistId: String, completion: @escaping GenericNetworkingCompletion<Gist>) {
        // response is an object
        let URLString = "https://api.github.com/gists/" + gistId
        GenericNetworking.getJSON(URLString: URLString, completion: completion)
    }
}

here you call GithubSDK like following


GithubSDK.getGists { (response) in
    switch response {
    case .success(let gists):
        print(gists.count)
        for gist in gists {
            print("gist id:(gist.identifider)")
        }
    case .error(let error):
        print(error)
    }
}

Requirements

  • Swift 4.0
  • Alamofire

Installation

GenericNetworking is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'GenericNetworking'

Author

alexiscn, [email protected]

License

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

Latest podspec

{
    "name": "GenericNetworking",
    "version": "0.1.2",
    "summary": "simple generic style networking framework",
    "description": "simple generic style networking framework base on Alamofire and Codable",
    "homepage": "https://github.com/alexiscn/GenericNetworking",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "alexiscn": "[email protected]"
    },
    "source": {
        "git": "https://github.com/alexiscn/GenericNetworking.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "GenericNetworking/Classes/**/*",
    "dependencies": {
        "Alamofire": []
    },
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This