列出相册中包含人脸的所有照片的框架
FaceCollectionViewKit
列出相册中包含人脸的所有照片的框架。
特征
- 它使用 CIDetectorTypeFace 的检测功能。
- 扫描所有相册,向您显示检测到面部的照片。
- 照片的质量不会下降。
- 可以更改检测设置。
- 缓存照片资产解决方法。
- 简单快捷。
用法
初始化
首先,在您想要显示相册的任何地方使用它。
FaceCollectionViewKit.shared.initialize(for: YOUR_CUSTOM_VIEW)
选择照片
当您从相册中选择一张照片时,就会触发此操作,只需在viewDidLoad()中调用一次即可。
FaceCollectionViewKit.shared.imageSelected = { [weak self] image in
//whatever you would like to do.
}
缓存同步
在退出相册屏幕时使用此选项。保存缓存的图像。
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
FaceCollectionViewKit.shared.sync()
}
安装
可可豆荚
To integrate FaceCollectionViewKit into your Xcode project using CocoaPods, specify it in your Podfile:
pod 'FaceCollectionViewKit', :git => 'https://github.com/serhatakalin/FaceCollectionViewKit.git'
Carthage
To integrate FaceCollectionViewKit into your Xcode project using Carthage, specify it in your Cartfile:
pod 'serhatakalin/FaceCollectionViewKit'
Manually
Add the Core folder to your Xcode project.
License
FaceCollectionViewKit is released under the MIT license. See LICENSE for more information.