TestsTested | ✓ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Dec 2016 |
SwiftSwift Version | 3.0.1 |
SPMSupports SPM | ✗ |
Maintained by Jason.
iPic could automatically upload images and save Markdown links on macOS.
Command + U
.Shift + Command + U
.Download iPic and have a try.
iPic opens the ability to upload images. It means if your App also needs to upload images, no need to build from scratch. Just use iPicUploader, your App could also upload images to Imgur, Flickr, Amazon S3 and other image hosts.
Upload image file:
let imageFilePath = "/Path/to/the/pic.jpg"
iPic.uploadImage(imageFilePath, handler: { (imageLink, error) in
if let imageLink = imageLink {
// Image uploaded
} else if let error = error {
// Some error happened
}
})
Upload image data:
let imageFilePath = "/Path/to/the/pic.jpg"
let imageURL = URL(fileURLWithPath: imageFilePath)
let imageData = try! Data(contentsOf: imageURL)
iPic.uploadImage(imageData, handler: { (imageLink, error) in
if let imageLink = imageLink {
// Image uploaded
} else if let error = error {
// Some error happened
}
})
Upload NSImage:
let imageFilePath = "/Path/to/the/pic.jpg"
let image = NSImage(contentsOfFile: imageFilePath)
iPic.uploadImage(image, handler: { (imageLink, error) in
if let imageLink = imageLink {
// Image uploaded
} else if let error = error {
// Some error happened
}
})
iPicUploader also includes a full example. You will feel easy to start. To run the example project, just clone current repository and open iPicUploader.xcworkspace.
Note:
Now, let's have a look how the example upload images.
As you can see, iPicUploader supports upload of multiple images at a time.
Beside copy image files, you can also copy the image in other Apps to upload.
It would be great to show your apps using iPicUploader here. Pull requests welcome :)
As iPic runs on macOS 10.11 and newer version, iPicUploader also needs macOS 10.11+
iPicUploader is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "iPicUploader"
iPicUploader is available under the MIT license.