https://github.com/maatheusgois/image-handler
Static Library Framework for download, upload and access camera and gallery in iOS.
https://github.com/maatheusgois/image-handler
image imagehandler ios swift swift-package-manager
Last synced: about 1 year ago
JSON representation
Static Library Framework for download, upload and access camera and gallery in iOS.
- Host: GitHub
- URL: https://github.com/maatheusgois/image-handler
- Owner: MaatheusGois
- Created: 2020-03-27T20:43:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T00:24:31.000Z (about 6 years ago)
- Last Synced: 2025-01-28T20:31:12.029Z (over 1 year ago)
- Topics: image, imagehandler, ios, swift, swift-package-manager
- Language: Swift
- Homepage:
- Size: 5.27 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageHandler
This **handler** is to helper you with your image manager in your projects.
## Preview

## Examples
- [Server on Github](https://github.com/MaatheusGois/ImageUpload)
### Usage
Picker
```swift
import ImageHandler
ImageHandler.share.pickImage(self) { image in
//image here
}
```
Upload (save image in jpeg only)
```swift
import ImageHandler
let image = UIImage() //put here your image
ImageHandler.share.uploadRequest(url: "\(url)/upload",
image: image,
imageName: "potato.jpeg",
compression: 0.3,
filePathKey: "fileUploader") { (response) in
switch response {
case .success(let answer):
print(answer)
case .error(let description):
print(description)
}
}
```
Download
```swift
import ImageHandler
let url = "http://localhost:3000/flowersImage.jpeg"
ImageHandler.share.downloadImageFromServerURL(urlString: "") { (response) in
switch response {
case .success(let answer):
//answer is your image
break
case .error(let description):
print(description)
}
}
```
## Warning
Don't forget of set the "Privacity Key" in Info.plist:
```
NSCameraUsageDescription
```
And if you test in localhost server, you need desabilite the secure connection:
```
NSAppTransportSecurity
NSAllowsArbitraryLoads
```
And when the test moment is finish, enable again o7.