YPImagePicker alternatives and similar libraries
Based on the "Images" category.
Alternatively, view YPImagePicker alternatives based on common mentions on social networks and blogs.
-
SDWebImage
Asynchronous image downloader with cache support as a UIImageView category -
SwiftGen-Assets
A tool to auto-generate Swift enums for all your UIImages from your Assets Catalogs. -
Nuke
Advanced pure Swift framework for loading, caching, processing, displaying and preheating images. -
HanekeSwift
A lightweight generic cache for iOS written in Swift with extra love for images. -
GPUImage 2
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing. -
AlamofireImage
AlamofireImage is an image component library for Alamofire. -
SkyFloatingLabelTextField
A beautiful and flexible text field control implementation of "Float Label Pattern". -
GPUImage 3
GPUImage 3 is a BSD-licensed framework for GPU-accelerated video and image processing using Metal. -
APNGKit
High performance and delightful way to play with APNG format in iOS. -
TinyCrayon
A smart and easy-to-use image masking and cutout SDK for mobile apps. -
SwiftSVG
A single pass SVG parser with multiple interface options (String, NS/UIBezierPath, CAShapeLayer, and NS/UIView) -
Lightbox
A convenient and easy to use image viewer for your iOS app. -
CTPanoramaView
A library that displays spherical or cylindrical panoramas with touch or motion based controls. -
AXPhotoViewer
An iPhone/iPad photo gallery viewer, useful for viewing a large (or small!) number of photos. -
FMPhotoPicker
A modern, simple and zero-dependency photo picker with an elegant and customizable image editor -
PassportScanner
Scan the MRZ code of a passport and extract the first name, last name, passport number, nationality, date of birth, expiration date and personal number. -
XAnimatedImage
XAnimatedImage is a performant animated GIF engine for iOS written in Swift based on FLAnimatedImage -
Viewer
Image viewer (or Lightbox) with support for local and remote videos and images. -
UIImageView-BetterFace-Swift
autoresize images and if any face discovered refine the position of the image. -
JLStickerTextView
A UIImageView allow you to add multiple Label (multiple line text support) on it, you can edit, rotate, resize the Label as you want with one finger ,then render the text on Image. -
KFSwiftImageLoader
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and ๏ฃฟ Watch. -
Moa
An image download extension of the image view for iOS, tvOS and macOS. -
MCScratchImageView
A custom ImageView that is used to cover the surface of other view like a scratch card, user can swipe the mulch to see the view below -
ImageLoader
A lightweight and fast image loader for iOS written in Swift. -
ImageDetect
Detect and crop faces, barcodes and texts in image with iOS 11 Vision API. -
SwiftColorArt
font schema generator according image colours. -
FacebookImagePicker
Facebook album photo picker written in Swift. -
DTPhotoViewerController
A fully customizable photo viewer ViewController to display single photo or collection of photos, inspired by Facebook photo viewer. -
Kanvas
A iOS library for adding effects, drawings, text, stickers, and making GIFs from existing media or the camera. -
ATGMediaBrowser
Image slide-show viewer with multiple predefined transition styles, and with ability to create new transitions with ease. -
LetterAvatarKit
A UIImage extension that generates letter-based avatars. -
PASImageView
async remote download your image and round them. automatically.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of YPImagePicker or a related project?
README
YPImagePicker
YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It is feature-rich and highly customizable to match your App's requirements.
Installation - Configuration - Usage - Languages - UI Customization
Give it a quick try :
pod repo update
then pod try YPImagePicker
Those features are available just with a few lines of code!
Notable Features
๐
Library
๐ท Photo
๐ฅ Video
โ๏ธ Crop
โก๏ธ Flash
๐ผ Filters
๐ Albums
๐ข Multiple Selection
๐ Video Trimming & Cover selection
๐ Output image size
And many more...
Installation
Experimental Swift Package Manager (SPM) Support
A first version of SPM support is available :
package https://github.com/Yummypets/YPImagePicker
branch spm
.
This has a minimum target iOS version of 12.0
.
This is an early release so be sure to thoroughly test the integration and report any issues you'd encounter.
Side note:
Swift package manager is the future and I would strongly recommend you to migrate as soon as possible.
Once this integration is stable, the other packager managers will be deprecated.
Using CocoaPods
First be sure to run pod repo update
to get the latest version available.
Add pod 'YPImagePicker'
to your Podfile
and run pod install
. Also add use_frameworks!
to the Podfile
.
target 'MyApp'
pod 'YPImagePicker'
use_frameworks!
Using Carthage
Add github "Yummypets/YPImagePicker"
to your Cartfile
and run carthage update
. If unfamiliar with Carthage then checkout their Getting Started section.
github "Yummypets/YPImagePicker"
Plist entries
In order for your app to access camera and photo libraries,
you'll need to ad these plist entries
:
- Privacy - Camera Usage Description (photo/videos)
- Privacy - Photo Library Usage Description (library)
- Privacy - Microphone Usage Description (videos)
<key>NSCameraUsageDescription</key>
<string>yourWording</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>yourWording</string>
<key>NSMicrophoneUsageDescription</key>
<string>yourWording</string>
Configuration
All the configuration endpoints are in the YPImagePickerConfiguration struct. Below are the default value for reference, feel free to play around :)
var config = YPImagePickerConfiguration()
// [Edit configuration here ...]
// Build a picker with your configuration
let picker = YPImagePicker(configuration: config)
General
config.isScrollToChangeModesEnabled = true
config.onlySquareImagesFromCamera = true
config.usesFrontCamera = false
config.showsPhotoFilters = true
config.showsVideoTrimmer = true
config.shouldSaveNewPicturesToAlbum = true
config.albumName = "DefaultYPImagePickerAlbumName"
config.startOnScreen = YPPickerScreen.photo
config.screens = [.library, .photo]
config.showsCrop = .none
config.targetImageSize = YPImageSize.original
config.overlayView = UIView()
config.hidesStatusBar = true
config.hidesBottomBar = false
config.hidesCancelButton = false
config.preferredStatusBarStyle = UIStatusBarStyle.default
config.bottomMenuItemSelectedColour = UIColor(r: 38, g: 38, b: 38)
config.bottomMenuItemUnSelectedColour = UIColor(r: 153, g: 153, b: 153)
config.filters = [DefaultYPFilters...]
config.maxCameraZoomFactor = 1.0
config.preSelectItemOnMultipleSelection = true
config.fonts..
Library
config.library.options = nil
config.library.onlySquare = false
config.library.isSquareByDefault = true
config.library.minWidthForItem = nil
config.library.mediaType = YPlibraryMediaType.photo
config.library.defaultMultipleSelection = false
config.library.maxNumberOfItems = 1
config.library.minNumberOfItems = 1
config.library.numberOfItemsInRow = 4
config.library.spacingBetweenItems = 1.0
config.library.skipSelectionsGallery = false
config.library.preselectedItems = nil
Video
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
Gallery
config.gallery.hidesRemoveButton = false
Default Configuration
// Set the default configuration for all pickers
YPImagePickerConfiguration.shared = config
// And then use the default configuration like so:
let picker = YPImagePicker()
When displaying picker on iPad, picker will support one size only you should set it before displaying it:
let preferredContentSize = CGSize(width: 500, height: 600);
YPImagePickerConfiguration.widthOniPad = preferredContentSize.width;
// Now you can Display the picker with preferred size in dialog, popup etc
Usage
First things first import YPImagePicker
.
The picker only has one callback didFinishPicking
enabling you to handle all the cases. Let's see some typical use cases ๐ค
Single Photo
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)
Single video
// Here we configure the picker to only show videos, no photos.
var config = YPImagePickerConfiguration()
config.screens = [.library, .video]
config.library.mediaType = .video
let picker = YPImagePicker(configuration: config)
picker.didFinishPicking { [unowned picker] items, _ in
if let video = items.singleVideo {
print(video.fromCamera)
print(video.thumbnail)
print(video.url)
}
picker.dismiss(animated: true, completion: nil)
}
present(picker, animated: true, completion: nil)
As you can see singlePhoto
and singleVideo
helpers are here to help you handle single media which are very common, while using the same callback for all your use-cases \o/
Multiple selection
To enable multiple selection make sure to set library.maxNumberOfItems
in the configuration like so:
var config = YPImagePickerConfiguration()
config.library.maxNumberOfItems = 3
let picker = YPImagePicker(configuration: config)
Then you can handle multiple selection in the same callback you know and love :
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)
}
}
picker.dismiss(animated: true, completion: nil)
}
Handle Cancel event (if needed)
picker.didFinishPicking { [unowned picker] items, cancelled in
if cancelled {
print("Picker was canceled")
}
picker.dismiss(animated: true, completion: nil)
}
That's it !
Languages
๐บ๐ธ English, ๐ช๐ธ Spanish, ๐ซ๐ท French ๐ท๐บ Russian, ๐ต๐ฑ Polish, ๐ณ๐ฑ Dutch, ๐ง๐ท Brazilian, ๐น๐ท Turkish, ๐ธ๐พ Arabic, ๐ฉ๐ช German, ๐ฎ๐น Italian, ๐ฏ๐ต Japanese, ๐จ๐ณ Chinese, ๐ฎ๐ฉ Indonesian, ๐ฐ๐ท Korean, ๐น๐ผ Traditional Chinese๏ผTaiwan), ๐ป๐ณ Vietnamese, ๐น๐ญ Thai.
If your language is not supported, you can still customize the wordings via the configuration.wordings
api:
config.wordings.libraryTitle = "Gallery"
config.wordings.cameraTitle = "Camera"
config.wordings.next = "OK"
Better yet you can submit an issue or pull request with your Localizable.strings
file to add a new language !
UI Customization
We tried to keep things as native as possible, so this is done mostly through native Apis.
Navigation bar color
let coloredImage = UIImage(color: .red)
UINavigationBar.appearance().setBackgroundImage(coloredImage, for: UIBarMetrics.default)
// UIImage+color helper https://stackoverflow.com/questions/26542035/create-uiimage-with-solid-color-in-swift
Navigation bar fonts
let attributes = [NSAttributedString.Key.font : UIFont.systemFont(ofSize: 30, weight: .bold) ]
UINavigationBar.appearance().titleTextAttributes = attributes // Title fonts
UIBarButtonItem.appearance().setTitleTextAttributes(attributes, for: .normal) // Bar Button fonts
Navigation bar Text colors
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor : UIColor.yellow ] // Title color
UINavigationBar.appearance().tintColor = .red // Left. bar buttons
config.colors.tintColor = .green // Right bar buttons (actions)
Original Project & Author
This project has been first inspired by Fusuma Considering the big code, design changes and all the additional features added along the way, this moved form a fork to a standalone separate repo, also for discoverability purposes. Original Fusuma author is ytakz
Core Team
Contributors ๐
ezisazis, hanikeddah, tahaburak, ajkolean, Anarchoschnitzel, Emil, Rafael Damasceno, cenkingunlugu heitara portellaa Romixery shotat
Special thanks to ihtiht for the cool looking logo!
They helped us one way or another ๐
userdar, Evgeniy, MehdiMahdloo, om-ha, userdar, ChintanWeapp, eddieespinal, viktorgardart, gdelarosa, cwestMobile, Tinyik, Vivekthakur647, tomasbykowski, artemsmikh, theolof, dongdong3344, MHX792, CIronfounderson, Guerrix, Zedd0202, mohammadZ74, SalmanGhumsani, wegweiser6, BilalAkram, KazimAhmad, JustinBeBoy, SashaMeyer, GShushanik, Cez95, Palando, sebastienboulogne, JigneshParekh7165, Deepakepaisa, AndreiBoariu, nathankonrad1, wawilliams003, pngo-hypewell, PawanManjani, devender54321, Didar1994, relaxsus restoflash
Dependency
YPImagePicker relies on prynt/PryntTrimmerView for provide video trimming and cover features. Big thanks to @HHK1 for making this open source :)
Obj-C support
Objective-C is not supported and this is not on our roadmap. Swift is the future and dropping Obj-C is the price to pay to keep our velocity on this library :)
License
YPImagePicker is released under the MIT license.
See [LICENSE](LICENSE) for details.
Swift Version
*Note that all licence references and agreements mentioned in the YPImagePicker README section above
are relevant to that project's source code only.