# ZLPhotoBrowser
**Repository Path**: privchat/ZLPhotoBrowser
## Basic Information
- **Project Name**: ZLPhotoBrowser
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-01-26
- **Last Updated**: 2024-01-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
[](https://cocoapods.org/pods/ZLPhotoBrowser)
[](https://github.com/Carthage/Carthage)
[](https://swift.org/package-manager/)
[](https://raw.githubusercontent.com/longitachi/ZLPhotoBrowser/master/LICENSE)
[](https://img.shields.io/badge/Platforms-iOS-blue?style=flat)

[](https://github.com/longitachi/ZLPhotoBrowser/wiki/How-to-use-(Swift))

----------------------------------------
English | [简体中文](https://github.com/longitachi/ZLPhotoBrowser/blob/master/README_CN.md)
ZLPhotoBrowser is a Wechat-like image picker. Support select normal photos, videos, gif and livePhoto. Support edit image and crop video.
### Directory
* [Features](#features)
* [Requirements](#requirements)
* [Usage](#usage)
* [Change Log](#change-log)
* [Languages](#languages)
* [Installation(Support Cocoapods/Carthage/SPM)](#installation)
* [Support](#support)
* [Demo Effect](#demo-effect)
Detailed usage of `Swift` and `OC`, please refer to [Wiki](https://github.com/longitachi/ZLPhotoBrowser/wiki).
If you only want to use the image edit feature, please move to [ZLImageEditor](https://github.com/longitachi/ZLImageEditor).
### Features
- [x] Portrait and landscape.
- [x] Two framework style.
- [x] Preview selection (Support drag and drop).
- [x] Library selection (Support sliding selection).
- [x] Image/Gif/LivePhoto/Video.
- [x] Customize the maximum number of previews or selection, the maximum and minimum optional duration of the video.
- [x] Customize the number of columns displayed in each row.
- [x] Image editor (Draw/Crop/Image sticker/Text sticker/Mosaic/Filter/Adjust(Brightness, Contrast and Saturation)), (Draw color can be customized; Crop ratio can be customized; Filter effect can be customized; You can choose the editing tool you want).
- [x] Video editor.
- [x] Custom camera.
- [x] Multi-language.
- [x] Selected index.
- [x] Selected/unselectable state shadow mask.
- [x] The selected photos are displayed at the bottom of the big picture interface, which can be dragged and sorted.
- [x] The camera's internal photo cell can displays the captured images of the camera.
- [x] Customize font.
- [x] The color of each part of the framework can be customized (Provide dynamic color can support light/dark mode).
- [x] Customize images.
> If you have good needs and suggestions in use, or encounter any bugs, please create an issue and I will reply in time.
### Requirements
* iOS 10.0
* Swift 5.x
* Xcode 13.x
### Usage
- Preview selection
```swift
let ps = ZLPhotoPreviewSheet()
ps.selectImageBlock = { [weak self] results, isOriginal in
// your code
}
ps.showPreview(animate: true, sender: self)
```
- Library selection
```swift
let ps = ZLPhotoPreviewSheet()
ps.selectImageBlock = { [weak self] results, isOriginal in
// your code
}
ps.showPhotoLibrary(sender: self)
```
- Pay attention, you need to add the following key-value pairs in your app's Info.plist
```
// If you don’t add this key-value pair, multiple languages are not supported, and the album name defaults to English
Localized resources can be mixed YES
Privacy - Photo Library Usage Description
Privacy - Camera Usage Description
Privacy - Microphone Usage Description
```
### Change Log
> [More logs](https://github.com/longitachi/ZLPhotoBrowser/blob/master/CHANGELOG.md)
```
● 4.4.8.1 - 4.4.8.2 (4.4.8 Patch)
Fix:
Fix the bug where the camera does not disappear when clicking cancel in the system camera.
● 4.4.8
Add:
Adapt to iOS 17, replace UIGraphicsBeginImageContextWithOptions with UIGraphicsImageRenderer.
Fix:
Fix the bug in ZLImagePreviewController where videos cannot be played.
● 4.4.7
Add:
Enhancing the drawing tool with an eraser function.
Display the total size of selected photos when the full image button is selected.
Fix:
Fix a bug where the video's start time is incorrect when cropping the video.
● 4.4.6
Add:
Supports setting whether the serial number is displayed on the selection button or not.
Add scroll to bottom button on Gallery picker.
In the image editor, all operations support undo and redo.
Dutch support added.
Supports setting the default font for text stickers.
Optimize the drop-down return effect of the preview interface.
Optimize screen rotation experience.
Fix:
Fix the bug that text stickers are not displayed when typing in Arabic.
...
```
### Languages
🇨🇳 Chinese, 🇺🇸 English, 🇯🇵 Japanese, 🇫🇷 French, 🇩🇪 German, 🇷🇺 Russian, 🇻🇳 Vietnamese, 🇰🇷 Korean, 🇲🇾 Malay, 🇮🇹 Italian, 🇮🇩 Indonesian, 🇪🇸 Spanish, 🇵🇹 Portuguese, 🇹🇷 Turkish, 🇸🇦 Arabic, 🇳🇱 Dutch.
### Installation
There are four ways to use ZLPhotoBrowser in your project:
- using CocoaPods
- using Carthage
- using Swift Package Manager
- manual install (build frameworks or embed Xcode Project)
#### CocoaPods
To integrate ZLPhotoBrowser into your Xcode project using CocoaPods, specify it to a target in your Podfile:
```
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
# your other pod
# ...
pod 'ZLPhotoBrowser'
end
```
Then, run the following command:
```
$ pod install
```
> If you cannot find the latest version, you can execute `pod repo update` first
#### Carthage
To integrate ZLPhotoBrowser into your Xcode project using Carthage, specify it in your Cartfile:
```
github "longitachi/ZLPhotoBrowser"
```
Then, run the following command to build the ZLPhotoBrowser framework:
```shell
$ carthage update
```
If you get an error like `Building universal frameworks with common architectures is not possible. The device and simulator slices for "ZLPhotoBrowser" both build for: arm64
Rebuild with --use-xcframeworks to create an xcframework bundle instead.` [Click this link](https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md).
#### Swift Package Manager
1. Select File > Add Packages. Enter https://github.com/longitachi/ZLPhotoBrowser.git in the "Choose Package Repository" dialog.
2. In the next page, specify the version resolving rule as "Up to Next Major" with "4.4.8.2" as its earliest version.
3. After Xcode checking out the source and resolving the version, you can choose the "ZLPhotoBrowser" library and add it to your app target.
### Support
* [**★ Star**](#) this repo.
* Support with
or
or
### Demo Effect
- Selection



- Image editor

- Video editor

- Multi-language

- Custom camera
