Skip to content

Datt1994/ApiCallWithCodable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

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/#", 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 ?? "")
            }
        }

Releases

No releases published

Packages

No packages published

Languages