Fusuma is a Swift library that provides an Instagram-like photo browser with a camera feature using only a few lines of code.
You can use Fusuma instead of UIImagePickerController. It also has a feature to take a square-sized photo.
- 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
- Colors fully customizable
Those features are available just with a few lines of code!
Download and drop the 'Classes' folder into your Xcode project.
Using CocoaPods
Add pod 'Fusuma'
to your Podfile
and run pod install
. Also add use_frameworks!
to the Podfile
.
use_frameworks!
pod 'Fusuma'
The latest version does support Swift 4.2. If you're still using Swift 3, you can install Fusuma as follows:
pod 'Fusuma', git: 'git@github.com:ytakzk/Fusuma.git', branch: 'swift-3'
Import Fusuma import Fusuma
then use the following codes in some function except for viewDidLoad and give FusumaDelegate to the view controller.
let fusuma = FusumaViewController()
fusuma.delegate = self
present(fusuma, animated: true, completion: nil)
// or
navigationController?.pushViewController(fusuma, animated: true)
// The image selected in single mode (from gallery or taken with the camera).
func fusumaImageSelected(_ image: UIImage, source: FusumaMode, metaData: ImageMetadata?)
// Images selected in multiple selection mode (only from the gallery).
func fusumaMultipleImageSelected(_ images: [UIImage], source: FusumaMode, metaData: [ImageMetadata])
// Called just after a video has been selected.
func fusumaVideoCompleted(withFileURL fileURL: URL)
// When camera roll is not authorized, this method is called.
func fusumaCameraRollUnauthorized()
// Optional. Called when the user taps the cancel/close button.
func fusumaCancel()
// Optional. In multiple selection mode, called when the user tries to select more photos than allowed.
func fusumaLimitReached()
let fusuma = FusumaViewController()
fusuma.delegate = self
// ...
fusumaCameraRollTitle = "CustomizeCameraRollTitle"
fusumaCameraTitle = "CustomizeCameraTitle" // Camera Title
fusumaTintColor: UIColor // tint color
// ...
self.present(fusuma, animated: true, completion: nil)
ytakzk
https://ytakzk.me
Fusuma is released under the MIT license.
See LICENSE for details.