ImagePicker has been optimized to give a great user experience, it passes around referenced images instead of the image itself which makes it less memory consuming. This is what makes it smooth as butter.
ImagePicker works as a normal controller, just instantiate it and present it.
let imagePickerController = ImagePickerController()
imagePickerController.delegate = self
presentViewController(imagePickerController, animated: true, completion: nil)
ImagePicker has three delegate methods that will inform you what the users are up to:
func wrapperDidPress(images: [UIImage])
func doneButtonDidPress(images: [UIImage])
func cancelButtonDidPress()
ImagePicker supports limiting the amount of images that can be selected, it defaults to zero, which means that the user can select as many images as he/she wants.
let imagePickerController = ImagePickerController()
imagePickerController.imageLimit = 5
Configure text, colors, fonts and camera features by just overriding the static variables in the ImagePicker configuration struct. As an example:
Configuration.doneButtonTitle = "Finish"
Configuration.noImagesTitle = "Sorry! There are no images here!"
As said before, ImagePicker works with referenced images, that is really powerful because it lets you download the asset and choose the size you want. If you want to change the default implementation, just add a variable in your controller.
public var imageAssets: [UIImage] {
return ImagePicker.resolveAssets(imagePicker.stack.assets)
}
And when you call any delegate method that returns images, add in the first line:
let images = imageAssets
ImagePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ImagePicker'
ImagePicker is also available through Carthage. To install just write into your Cartfile:
github "hyperoslo/ImagePicker"
Hyper made this with ❤️. If you’re using this library we probably want to hire you! Send us an email at ios@hyper.no.
We would love you to contribute to ImagePicker, check the CONTRIBUTING file for more info.
ImagePicker is available under the MIT license. See the LICENSE file for more info.