Swiftpack.co - Package - hyperoslo/ImagePicker

ImagePicker

Carthage Compatible License Platform

Description

ImagePicker Icon

ImagePicker is an all-in-one camera solution for your iOS app. It lets your users select images from the library and take pictures at the same time. As a developer you get notified of all the user interactions and get the beautiful UI for free, out of the box, it's just that simple.

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.

Usage

ImagePicker works as a normal controller, just instantiate it and present it.

let imagePickerController = ImagePickerController()
imagePickerController.delegate = self
present(imagePickerController, animated: true, completion: nil)

ImagePicker has three delegate methods that will inform you what the users are up to:

func wrapperDidPress(_ imagePicker: ImagePickerController, images: [UIImage])
func doneButtonDidPress(_ imagePicker: ImagePickerController, images: [UIImage])
func cancelButtonDidPress(_ imagePicker: ImagePickerController)

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

Optional bonus

Configuration

You can inject Configuration instance to ImagePicker, which allows you to configure text, colors, fonts and camera features

var configuration = Configuration()
configuration.doneButtonTitle = "Finish"
configuration.noImagesTitle = "Sorry! There are no images here!"
configuration.recordLocation = false

let imagePicker = ImagePickerController(configuration: configuration)
Resolve assets

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 AssetManager.resolveAssets(imagePicker.stack.assets)
}

And when you call any delegate method that returns images, add in the first line:

let images = imageAssets

Installation

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"

Author

Hyper made this with ❤️

Contribute

We would love you to contribute to ImagePicker, check the CONTRIBUTING file for more info.

License

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

Github

link
Stars: 4423

Dependencies

Used By

Total: 0

Releases

ImagePicker — 3.2.0 - 2020-06-04 23:39:21

Update to Swift 5 and Xcode 11.

3.1.0 - 2018-08-15 13:37:22

  • Add support for Objective-C, remove deprecations #358
  • Bump version to indicate Obj-C support #360
  • Unowned refrence when taking picutre fix #364
  • Added config value for handling volume actions #365
  • Dismiss when only one photo requested and selected #367
  • Add iPhoneX layout support #372
  • Fix accessibility labels #389
  • Fix build by making code succeed linting. #401

3.0.0 - 2017-10-09 12:20:49

  • Swift 4 support 🎉

2.1.1 - 2017-04-03 08:07:04

  • Fix deprecated M_PI https://github.com/hyperoslo/ImagePicker/pull/279

2.1.0 - 2017-03-24 08:55:47

  • Allow iCloud asset https://github.com/hyperoslo/ImagePicker/pull/262
  • Use Configuration as instance https://github.com/hyperoslo/ImagePicker/pull/257
  • Fix loading https://github.com/hyperoslo/ImagePicker/pull/253
  • Limit the number of images selected https://github.com/hyperoslo/ImagePicker/pull/245
  • Option to select back or front camera as default https://github.com/hyperoslo/ImagePicker/pull/226
  • Color customization https://github.com/hyperoslo/ImagePicker/pull/239

2.0.0 - Swift 3 - 2016-10-13 10:41:16

This release includes the Swift 3 implementation of ImagePicker!

1.4.1 - 2016-09-26 07:41:18

  • Fix deliveryMode https://github.com/hyperoslo/ImagePicker/pull/207
  • Added ability to provide a preferred image size https://github.com/hyperoslo/ImagePicker/pull/193
  • Add an accessiblity label to the stack view https://github.com/hyperoslo/ImagePicker/pull/188
  • Fix orientation https://github.com/hyperoslo/ImagePicker/pull/190
  • Added ability to provide a preferred image size https://github.com/hyperoslo/ImagePicker/pull/193

1.4.0 - 2016-08-01 09:07:02

  • Improve stack view https://github.com/hyperoslo/ImagePicker/pull/176
  • Refactor to AssetManager https://github.com/hyperoslo/ImagePicker/pull/184
  • Add accessibility label https://github.com/hyperoslo/ImagePicker/pull/185
  • Handle landscape rotation https://github.com/hyperoslo/ImagePicker/pull/186

1.3.0 - 2016-05-22 10:13:35

  • Migrate to Swift 2.2 #119
  • Fixes image selection #120
  • Internal refactoring #121
  • Features AssetManager #122
  • LocationManager has been moved into its own file #128
  • Some rotation based issues are fixed #127
  • Fixes "No image available" label position #130
  • Fixes image limit bug #129
  • Fixes UI when Camera access is denied #133
  • Internal refactoring to handle permissions more efficiently #136
  • Reloads data after collection size is change #139
  • Properly reset transform and contentInset when in viewDidAppear #140
  • Fix crash on iPad by removing sessionPreset #134
  • Refactor ImageGalleryPanGestureDelegate #132

1.2 - 2016-03-18 13:02:26

This release includes various PR from the community and small fixes.

Special thank's to @fnakstad and all the other contributors! :)

1.1 - 2016-01-05 08:47:38

In this version 1.1 of the ImagePicker there are some changes:

  • You don't have to worry now to set the status bar hidden or not, ImagePicker will set the initial state.
  • ImagePicker now supports a maximum amount of pictures you can select. #66.

Thank you for all the issues filed! :)