YPImagePicker is an instagram-like photo/video picker for iOS written in pure Swift. It comes with adjustable square crop and filters.
Features | |
---|---|
🌅 | Library |
📷 | Photo |
🎥 | Video |
✂️ | Crop |
⚡️ | Flash |
🖼 | Filters |
Those features are available just with a few lines of code!
YPImagePicker was built from the great Fusuma library.
Here are the improvements we added :
- Improve Overall Code Quality
- Simplify API
- Added Filters View ala Instagram
- Replaces icons with lighter Text
- Preselect Front camera (e.g for avatars)
- Scroll between tabs which feels smoother
- Grab videos form the library view as well
- Replaces Delegate based with callbacks based api
- Uses Native Navigation bar over custom View (gotta be a good UIKit citizen)
Drop in the Classes folder to your Xcode project.
You can also use CocoaPods or Carthage.
Using CocoaPods
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"
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)
import YPImagePicker
then use the following:
let picker = YPImagePicker()
// picker.onlySquareImages = true
// picker.showsFilters = false
// picker.startsOnCameraMode = true
// picker.usesFrontCamera = true
// picker.showsVideo = true
picker.didSelectImage = { img in
// image picked
}
picker.didSelectVideo = { videoData in
// video picked
}
present(picker, animated: true, completion: nil)
This project has been first inspired by Fusuma Considering the big code and design changes, this moved form a fork to a standalone separate repo, also for discoverability purposes. Original Fusuma author is ytakz
YPImagePicker is released under the MIT license.
See LICENSE for details.
Swift 3 -> version 1.2.1
Swift 4 -> version 2.0.0