CocoaPods trunk is moving to be read-only. Read more on the blog, there are 16 months to go.

AlamofireKit 1.0.1

AlamofireKit 1.0.1

Maintained by Rz Rasel.



  • By
  • Md. Rashed - Uz - Zaman (Rz Rasel)

AlamofireKit

Rz Rasel CI Status Version License Platform GitHub release Swift Xcode

AlamofireKit latest version - 0.1.1.01 and upcoming next version - 0.1.1.02

Example

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

Requirements

  • iOS 11
  • Swift 5
  • Xcode 12

Installation

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

pod 'AlamofireKit'

or

pod 'AlamofireKit', '~> 0.1'

Integration In Project

import AlamofireKit

HTTP Request

AlamofireKit.request({ (success, data, error) in
    if success {
        guard let data = data else {
            return
        }
        self.apiModel = data
    } else {
        print("ERROR: \(String(describing: error))")
    }
}, dataModel: ApiModel.self, "https://api-url", method: .get, parameters: parameters)
let alamofireKit = AlamofireKit()
    .headers(headers: ["Authorization": self.rawUserLoginInfo.token])
    .addParameter(key: "type", value: "AVATAR")
    .method(method: .post)
    .withImageName(imageName: "file")
    .withImageFileName(imageFileName: "file.jpg")
    .withUIButton(uiButton: self.userImageButton, imageQuality: 100)
alamofireKit.uploadImage({success, data, error in
    if success {
        print("DATA: \(data?.jsonString())")
    }
}, dataModel: ModelApiRootUploadImage.self, "https://api-url", cropSize: CGSize(width: 512, height: 512))

Author

Md. Rashed - Uz - Zaman (Rz Rasel)

License

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