Install ZLImageEditor via Carthage
masterTo integrate ZLImageEditor using Carthage, add the following to your Cartfile:
github "longitachi/ZLImageEditor"Then, run the following command to build the framework:
$ carthage update ZLImageEditorrepository·master·Indexed 20 days ago
https://github.com/longitachi/zlimageeditorA Swift-based image editing framework for iOS. It provides tools for drawing, cropping, stickers, mosaics, filters, and color adjustments (brightness, contrast, and saturation) via the ZLEditImageViewController and ZLImageEditorConfiguration.
To integrate ZLImageEditor using Carthage, add the following to your Cartfile:
github "longitachi/ZLImageEditor"Then, run the following command to build the framework:
$ carthage update ZLImageEditorTo integrate ZLImageEditor using CocoaPods, add the following to your Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
pod 'ZLImageEditor'
endThen, execute pod install in your terminal. If you cannot find the latest version, run pod repo update first.
$ pod installhttps://github.com/longitachi/ZLImageEditor.git in the "Choose Package Repository" dialog.ZLImageEditor library and add it to your app target.You can present the image editor by configuring the tools available and calling ZLEditImageViewController.showEditImageVC.
Use ZLImageEditorConfiguration.default() to specify which editing tools (like .draw, .clip, .filter, etc.) and adjustment tools (like .brightness, .contrast, .saturation) are enabled. The completion handler returns the edited image and the editModel used.
ZLImageEditorConfiguration.default()
.editImageTools([.draw, .clip, .imageSticker, .textSticker, .mosaic, .filter, .adjust])
.adjustTools([.brightness, .contrast, .saturation])
ZLEditImageViewController.showEditImageVC(parentVC: self, image: image, editModel: editModel) { [weak self] (resImage, editModel) in
// your code
}When configuring ZLImageEditorConfiguration, you can enable the following tools:
Editing Tools (editImageTools):
.draw: Graffiti/drawing support..clip: Cropping support with custom ratios..imageSticker: Image stickers with custom container views..textSticker: Text stickers with custom colors..mosaic: Mosaic effect..filter: Custom filters..adjust: Brightness, contrast, and saturation adjustments.Adjustment Tools (adjustTools):
.brightness.contrast.saturation