Library / SDK
Yummypets/YPImagePicker avatar
Yummypets/YPImagePicker

YPImagePicker: one callback, and the defaults you inherit if you do not touch them

📸 Instagram-like image picker & filters for iOS

4,481 stars1,003 forksSwiftMIT

At a glance

What is it?
A pure Swift photo and video picker for iOS whose whole API is a single didFinishPicking callback plus a configuration struct. The defaults matter more than the features here: no crop step, no video screen, a sixty second video cap and .mov export at highest quality.
Who is it for?
Adopt YPImagePicker when you want a full picker with filters, a trimmer and albums on the same day you add it, and when your app can accept .mov output at highest quality for video or can change one config line. Do not adopt it when you need a small, dependency free picker, when you need cropping to be on by default, or when two screens in the same process need different picker configurations and you were planning to lean on the shared defaults.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 110 days ago.
What is it written in?
Mainly Swift, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 14, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • Yummypets/YPImagePicker4,481 ★ · -2
Star history
Repository2026-09-232026-11-14
Yummypets/YPImagePicker4.5k4.5k

-2 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

One callback covers single photo, single video and multiple

The API surface is unusually small. The README says the picker only has one callback, `didFinishPicking`, enabling you to handle all the cases, and the helpers `singlePhoto` and `singleVideo` exist for the two common single media cases while using the same callback for everything else.

The typical single photo call looks like this:

swift
let picker = YPImagePicker()
picker.didFinishPicking { [unowned picker] items, _ in
    if let photo = items.singlePhoto {
        print(photo.fromCamera) // Image source (camera or library)
        print(photo.image) // Final image selected by the user
        print(photo.originalImage) // original image selected by the user, unfiltered
        print(photo.modifiedImage) // Transformed image, can be nil
        print(photo.exifMeta) // Print exif meta data of original image.
    }
    picker.dismiss(animated: true, completion: nil)
}
present(picker, animated: true, completion: nil)

Two details in those lines will shape your integration. The closure captures the picker as `unowned`, which avoids a retain cycle between the picker and its own callback, and the dismissal happens inside the callback rather than in a delegate method. And the photo carries three images plus metadata rather than one image: the final image, the original unfiltered image, a transformed image that the README marks as possibly nil, and the exif data of the original. Code that only reads `photo.image` silently loses the untouched original.

The defaults do less than most people expect

Every knob is a property on `YPImagePickerConfiguration`, and the README prints the defaults so you can see what you get before changing anything. Four of them surprise people:

`config.screens = [.library, .photo]` means the video screen is not there unless you ask for it. `config.showsCrop = .none` means there is no crop step in the flow at all. `config.targetImageSize = YPImageSize.original` means you get full resolution images and do the downscaling yourself. `config.silentMode = true` is on by default.

One default has consequences outside your app: `config.shouldSaveNewPicturesToAlbum = true`, with `config.albumName` set to "DefaultYPImagePickerAlbumName". A user who takes a photo in your picker gets a copy written into their photo library under an album name you did not choose. If that is not the behaviour you want, it is one line, but it is one line you have to know exists.

The remaining defaults are ordinary interface choices: the front camera is off, photo filters and the video trimmer are on, the picker starts on the photo screen, and the status bar is hidden while the bottom bar and cancel button are shown.

maxNumberOfItems is the whole multiple selection switch

Multiple selection is not a separate mode. It is one library property, and the README's example is three lines:

swift
var config = YPImagePickerConfiguration()
config.library.maxNumberOfItems = 3
let picker = YPImagePicker(configuration: config)

The library defaults around it explain what the selection UI will do. `library.maxNumberOfItems` defaults to 1 and `library.minNumberOfItems` also defaults to 1, so there is a floor of one item and a ceiling you set. `library.defaultMultipleSelection` is false and `library.preSelectItemOnMultipleSelection` is true. `library.preselectedItems` is nil, so nothing starts selected, and `library.skipSelectionsGallery` is false, so the gallery can still show your existing selection.

The result type changes with the mode, which is the part worth planning for. In single mode you reach for `items.singlePhoto` or `items.singleVideo` and get an optional. In multiple mode you iterate the items and switch on the case:

swift
picker.didFinishPicking { [unowned picker] items, cancelled in
    for item in items {
        switch item {
        case .photo(let photo):
            print(photo)
        case .video(let video):
            print(video)
        }
    }

So a handler written for one item does not survive being reused for three, and the second closure parameter is the cancel flag, which the single photo example discards with `_`.

Video comes out as .mov at highest quality, capped at sixty seconds

The video defaults are the ones most likely to need changing before you ship, and they are all in one block:

swift
config.video.compression = AVAssetExportPresetHighestQuality
config.video.fileType = .mov
config.video.recordingTimeLimit = 60.0
config.video.libraryTimeLimit = 60.0
config.video.minimumTimeLimit = 3.0
config.video.trimmerMaxDuration = 60.0
config.video.trimmerMinDuration = 3.0

Three implications. The container is QuickTime, not MP4, so an upload path that only accepts `.mp4` needs `fileType` changed before your users pick anything. The compression preset is the highest quality one, which on a modern phone camera means large files and a re-encode rather than a copy. And both the recording limit and the library limit are sixty seconds, with a three second floor and a trimmer capped at the same sixty, so longer videos fall outside the defaults unless you raise the limits.

The video screen has to be enabled separately, since it is not in the default `screens` array. The README's video example sets `config.screens = [.library, .video]` and `config.library.mediaType = .video`, then reads `items.singleVideo` and uses `video.thumbnail`, `video.url` and `video.fromCamera`.

Also worth knowing: `config.gallery.hidesRemoveButton = false` by default, so the picker offers a way to remove an item from a selection, and it is a per gallery setting rather than a library one.

shared and widthOniPad are process wide, not per picker

There are two documented global settings, and both are assignments to the type rather than to an instance.

The first sets the configuration for every picker in the process:

swift
// Set the default configuration for all pickers
YPImagePickerConfiguration.shared = config

// And then use the default configuration like so:
let picker = YPImagePicker()

That is convenient in a small app and a trap in a large one, because two screens that both rely on `shared` cannot have different settings, and the assignment order decides which wins.

The second is the iPad width. The README says that when displaying the picker on iPad, the picker will support one size only and you should set it before displaying it:

swift
let preferredContentSize = CGSize(width: 500, height: 600);
YPImagePickerConfiguration.widthOniPad = preferredContentSize.width;

Note the shape of that fix. It is a static width, set globally and read by every picker, and the example uses a semicolon separated pair of statements rather than a Swift-idiomatic form, which suggests it is transcribed from older code. On iPad, where the picker is presented in a dialog or a popover, forgetting this line is the difference between a picker that fills the screen and one that is sized deliberately.

CocoaPods needs use_frameworks, SPM pins to 5.x

Two distribution routes, and the README treats CocoaPods as the primary one. It asks you to refresh the specs repo first, then to add the pod and a framework directive:

ruby
target 'MyApp'
pod 'YPImagePicker'
use_frameworks!

`use_frameworks!` is not optional in that snippet, so if your app links pods statically as a matter of policy, this integration changes that for your target.

For a quick look before committing, the README suggests updating the repo and then trying the pod directly, with `pod repo update` followed by `pod try YPImagePicker`, which builds the pod's own example application.

Swift Package Manager is the second route, either through File, Swift Packages, Add Package Dependency and the repository URL `https://github.com/Yummypets/YPImagePicker.git`, or by declaring it in your own package:

swift
.package(
name: "YPImagePicker",
url: "https://github.com/Yummypets/YPImagePicker.git",
.upToNextMajor(from: "5.0.0")
)

That pins your integration to the 5.x line, and the stated minimum target is iOS 12.0. The repository carries both sets of metadata for this, a `Podfile` and `YPImagePicker.podspec` beside `Package.swift`, `Package.resolved` and a `.swiftpm/` directory.

Three usage strings, and the placeholder text is not yours to ship

The picker needs the camera, the photo library and the microphone, so three keys go in your Info.plist:

xml
<key>NSCameraUsageDescription</key>
<string>yourWording</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>yourWording</string>
<key>NSMicrophoneUsageDescription</key>
<string>yourWording</string>

The microphone key is for video, the photo library key covers the library screen and the album write that `shouldSaveNewPicturesToAlbum` performs. Every one of the three strings in the example is the literal word `yourWording`, which is a placeholder: iOS shows this text in the system permission prompt, so an app that copies it through asks the user for permission in those exact words.

The release history suggests the project treats this area as unfinished business. Version 5.3.1 is titled iOS 26 support and shipped on 2025-09-18, 5.3.2 is titled Cocoapods support and shipped on 2025-09-21, and 5.4.0 on 2026-07-28 is titled for stability, performance and a privacy manifest. A privacy manifest in the newest release is the part that matters for anyone submitting an app, since Apple requires one for the SDKs you ship.

The repository is not archived and the last push was on 2026-07-28. It also carries a `.swiftlint.yml` at the root and an `Example/` app with its own Info.plist and localized `Base.lproj`.

Editorial conclusion

Adopt YPImagePicker when you want a full picker with filters, a trimmer and albums on the same day you add it, and when your app can accept .mov output at highest quality for video or can change one config line. Do not adopt it when you need a small, dependency free picker, when you need cropping to be on by default, or when two screens in the same process need different picker configurations and you were planning to lean on the shared defaults. Check four things before you ship: that all three usage description strings carry your own wording rather than the placeholder, that `config.screens` includes `.video` if you want the video screen at all, that `config.video.fileType` matches what your upload path expects, and that `YPImagePickerConfiguration.shared` and `widthOniPad` being process-wide state does not collide with another picker in the same app.

Frequently asked questions

How do I add YPImagePicker to an iOS project?

With CocoaPods, run `pod repo update` first, then add `pod 'YPImagePicker'` to your Podfile together with `use_frameworks!` and run `pod install`. With Swift Package Manager, add `https://github.com/Yummypets/YPImagePicker.git`, pinned as `.upToNextMajor(from: "5.0.0")`. The stated minimum target iOS version is 12.0.

Which Info.plist keys does YPImagePicker need?

Three usage descriptions: `NSCameraUsageDescription` for the camera, `NSPhotoLibraryUsageDescription` for the library, and `NSMicrophoneUsageDescription` for videos. The README's example fills each string with `yourWording`, so the wording has to be replaced with your own text before shipping, since iOS shows it in the permission prompt.

How do I enable multiple selection in YPImagePicker?

Set `config.library.maxNumberOfItems`, which defaults to 1; the README's example sets it to 3. The handler then switches over the returned items, which are either `.photo` or `.video`, instead of using the `singlePhoto` and `singleVideo` helpers. `config.library.minNumberOfItems` also defaults to 1.

How do I make YPImagePicker show video only?

Set `config.screens = [.library, .video]` and `config.library.mediaType = .video`, then read `items.singleVideo` in the `didFinishPicking` callback, where `video.thumbnail`, `video.url` and `video.fromCamera` are available. The default `screens` value is `[.library, .photo]`, so the video screen is off unless you add it.

What are the YPImagePicker video defaults?

`config.video.compression` is `AVAssetExportPresetHighestQuality`, `fileType` is `.mov`, `recordingTimeLimit` and `libraryTimeLimit` are both 60.0, `minimumTimeLimit` and `trimmerMinDuration` are 3.0, and `trimmerMaxDuration` is 60.0. A sixty second cap applies to both recording and library videos until you raise it.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. Releases
  5. Yummypets/YPImagePicker on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yummypets-ypimagepicker.svg)](https://hysenlabs.com/projects/yummypets-ypimagepicker)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/yummypets-ypimagepicker.svg)](https://hysenlabs.com/projects/yummypets-ypimagepicker)

Was this useful?