/ApiCallWithCodable

get & post web services with codable model class

Primary LanguageSwiftApache License 2.0Apache-2.0

ApiCallWithCodable

Language: Swift 5 License

Add Manually

Download Project and copy-paste ApiCall.swift file into your project

How to use

        var params = [String : Any]()
        params ["email_id"] = "datt@gmail.com"
        params ["password"] = "123456"
        
        ApiCall().post(apiUrl: "http://198.XX.XX.XX:XXXX/login", params: params, model: LoginModel.self) {
            result in
            switch result {
            case .success(let response):
                print(response)
            case .failure(let failureResponse):
                print(failureResponse.message ?? "")
            case .error(let e):
                print(e ?? "")
            }
        }