Swiftpack.co - SJ-Lyran/SJImagePickerViewController as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by SJ-Lyran.
SJ-Lyran/SJImagePickerViewController 1.2.3
A simple library that allows you to select images from the device library
⭐️ 7
🕓 1 week ago
iOS
.package(url: "https://github.com/SJ-Lyran/SJImagePickerViewController.git", from: "1.2.3")

SJImagePickerViewController

License MIT  CocoaPods  Support 

image

Installation

CocoaPods

  1. Add pod 'SJImagePickerController' to your Podfile.
  2. Run pod install or pod update.
  3. Import SJImagePickerController.

Swift Package Manager (SPM)

let package = Package( … dependencies: [ .package(url: "https://github.com/SJ-Lyran/SJImagePickerViewController.git", from: "1.2.2"), ], )

Manually

  1. Download all the files in the SJImagePickerController subdirectory.
  2. Add the source files to your Xcode project.
  3. Add NSPhotoLibraryUsageDescription
  4. info.plist insert
<key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
<true/>

Usage

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

let imagePicker = SJImagePickerController(delegate: self)
present(imagePicker, animated: true, completion: nil)

SJImagePickerController has two delegate methods that will inform you what the users are up to:

func imagePickerController(_ picker: SJImagePickerController, didFinishPickingMediaWithInfo info: [SJImagePickerController.InfoKey : Any])
func imagePickerControllerDidCancel(_ picker: SJImagePickerController)

SJImagePickerController supports limiting the amount of images that can be selected, it defaults to 9

let imagePicker = SJImagePickerController(delegate: self)
imagePicker.maximumSelectedPhotoCount = 9

GitHub

link
Stars: 7
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1.2.2
35 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics