To run the example project, clone the repo, and run pod install
from the Example directory first.
- iOS 11
- Swift 5
- Xcode 12
AlamofireKit is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'AlamofireKit'
or
pod 'AlamofireKit', '~> 1.0'
import AlamofireKit
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))
Md. Rashed - Uz - Zaman (Rz Rasel)
AlamofireKit is available under the MIT license. See the LICENSE file for more info.