Fusuma is a Swift library that provides an Instagram-like photo browser and a camera feature with a few line of code.
You can use Fusuma instead of UIImagePickerController. It also has a feature to take a square-sized photo.
YPFusuma is built from the great Fusuma library.
Here are the improvements we added :
- Improve Overall Code Quality
- Simpler 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)
- UIImagePickerController alternative
- Cropping images in camera roll
- Taking a square-sized photo and a video using AVFoundation
- Flash: On Off
- Camera Mode: Front Back
- Video Mode
Those features are available just with a few lines of code!
Drop in the Classes folder to your Xcode project.
You can also use CocoaPods or Carthage.
Using CocoaPods
Add pod 'Fusuma'
to your Podfile
and run pod install
. Also add use_frameworks!
to the Podfile
.
use_frameworks!
pod 'Fusuma'
Using Carthage
Add github "Yummypets/YPFusuma"
to your Cartfile
and run carthage update
. If unfamiliar with Carthage then checkout their Getting Started section.
github "Yummypets/YPFusuma"
Import Fusuma import Fusuma
then use the following codes in some function except for viewDidLoad and give FusumaDelegate to the view controller.
let picker = YPImagePicker()
// picker.showsFilters = false
// picker.startsOnCameraMode = true
// picker.usesFrontCamera = true
// picker.showsVideo = true
picker.didSelectImage = { img in
// image picked
}
picker.didSelectVideo = { videoURL in
// video picked
}
present(picker, animated: true, completion: nil)
ytakzk
http://ytakzk.me
Fusuma is released under the MIT license.
See LICENSE for details.