Latest 0.1.3
Homepage https://github.com/Cholarajan/Websync
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
Version
License
Platform

Example

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

Requirements

Installation

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

pod 'Websync'

How to use

STEP 1:

Your API Url

Websync.websynch_baseUrl = "https://your_api_url/"

Create structure for post data

struct pLogin: Codable {
var userName: String
var password: String
}

Create structure for response data

struct rLogin: Codable {
var success: Bool
var access_token: String
}

STEP 2:

Excecute simple API call

import Websync

let user = pLogin(userName: "[email protected]", password: "raj123456")

Websync().post(postBody: user, methodName: "users", expected: rLogin.self) { response, error in

if response != nil {

let userResponse = response as! rLogin
print(userResponse.success)

} else {

// Error message here..

}

}

Excecute API call with cache and header

Websync().post(postBody: user, methodName: "users", expected: rLogin.self, header: ["auth":"12121"], cache: true) { response, error in

if response != nil {

let userResponse = response as! rLogin
print(userResponse.success)

} else {

// Error message here..

}

}

Author

chola, [email protected]

License

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

Latest podspec

{
    "name": "Websync",
    "version": "0.1.3",
    "summary": "A simple web service handler.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/Cholarajan/Websync",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "[email protected]": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Cholarajan/Websync.git",
        "tag": "0.1.3"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Classes/*.{swift}",
    "frameworks": "UIKit",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This