paparazzo
Overview
Paparazzo is a component for picking and editing photos.
Key Features | |
---|---|
:camera: | Taking photos using camera |
:iphone: | Picking photos from user's photo library |
:scissors: | Photo cropping and rotation |
:droplet: | Applying filters to photos |
Contents
Using Marshroute:
pod "Paparazzo"
or if you don't use Marshroute and prefer not to get it as an additional dependency:
pod "Paparazzo/Core"
let factory = Paparazzo.AssemblyFactory()let assembly = factory.mediaPickerAssembly()
Create view controller using assembly's module
method:
let data = MediaPickerData( items: items, autocorrectionFilters: filters, selectedItem: items.last, maxItemsCount: maxItemsCount, cropEnabled: true, autocorrectEnabled: true, cropCanvasSize: cropCanvasSize)
let viewController = assembly.module( data: data, routerSeed: routerSeed, // omit this parameter if you're using Paparazzo.AssemblyFactory configure: configure)
Method parameters:
- items — array of photos that should be initially selected when module is presenter.
- filters — array of filters that can be applied to photos.
- selectedItem — selected photo. If set to
nil
or if items doesn't contain any photo with matching identifier, then the first photo in array will be selected. - maxItemsCount — maximum number of photos that user is allowed to pick.
- cropEnabled — boolean flag indicating whether user can perform photo cropping.
- autocorrectEnabled — boolean flag indicating whether user can apply filters to photo .
- cropCanvasSize — maximum size of canvas when cropping photos. (see Memory constraints when cropping).
- routerSeed — routerSeed provided by Marshroute.
- configure — closure that allows you to provide module's additional parameters.
let factory = Paparazzo.AssemblyFactory()let assembly = factory.photoLibraryAssembly()
Create view controller using assembly's module
method:
let viewController = assembly.module( selectedItems: selectedItems, maxSelectedItemsCount: maxSelectedItemsCount, routerSeed: routerSeed, // omit this parameter if you're using Paparazzo.AssemblyFactory configure: configure)
- selectedItems — preselected photos (or
nil
). - maxItemsCount — maximum number of photos that user is allowed to pick.
- routerSeed — routerSeed provided by Marshroute.
- configure — closure used to provide additional module setup.
let factory = Paparazzo.AssemblyFactory()let assembly = factory.maskCropperAssembly()
Create view controller using assembly's module
method:
let data = MaskCropperData( imageSource: photo.image, cropCanvasSize: cropCanvasSize)let viewController = assembly.module( data: data, croppingOverlayProvider: croppingOverlayProvider, routerSeed: routerSeed, // omit this parameter if you're using Paparazzo.AssemblyFactory configure: configure)
- imageSource — photo that should be cropped.
- croppingOverlayProvider — provider from CroppingOverlayProvidersFactory.
- routerSeed — routerSeed provided by Marshroute.
- configure — closure used to provide additional module setup.
let factory = Paparazzo.AssemblyFactory()let assembly = factory.scannerAssembly()
Create view controller using assembly's module
method:
let data = ScannerData( initialActiveCameraType: .back, cameraCaptureOutputHandlers: [])let viewController = assembly.module( data: data, routerSeed: routerSeed, // omit this parameter if you're using Paparazzo.AssemblyFactory configure: configure)
- initialActiveCameraType — preferred camera when starting the module (front or back).
- cameraCaptureOutputHandlers — array of handlers that confirm the ScannerOutputHandler protocol.
- routerSeed — routerSeed provided by Marshroute.
- configure — closure used to provide additional module setup.
https://github.com/avito-tech/ImageSource
here. If you don't see your language, we encourage you to contribute to the project by creating pull request that adds Localizable.strings
file for that language.
If you're not satisfied with a string that is provided by Paparazzo, you can override it in your project. Just add Paparazzo.strings
to your main bundle. Override only the strings you need (you can see an example of this in PaparazzoExample project).
License
MIT
Описание
Custom iOS camera and photo picker with editing capabilities
Языки
Swift
- Ruby
- Objective-C