PhotoLibraryManager
示例
要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install
需求
iOS 10 及以上。
安装
PhotoLibraryManager 通过 CocoaPods 提供。要安装,只需在 Podfile 中添加以下行
pod 'PhotoLibraryManager'
API
import PhotoLibraryManager
let photoManager = PhotoLibraryManager()
在 photoManager 中使用以下函数来获取您想要的功能
文档
PhotoLibraryManager 托供以下公共方法
- checkAuthorisationStatus(vc: UIViewController?, completion: @escaping ((Bool) -> Void))
Returns a boolean value indicating whether we have access to photoLibrary
- containsAlbum(albumName: String) -> Bool
Returns a boolean value indicating whether photo library contains a specific album
- makeAlbum(albumName: String)
Makes a specific album in photo library
- savePhotoToAlbum(albumName: String, photo:UIImage, completion: ((_ identifier: String?, _ error: Error?) -> Void)?)
Returns the saved image identifier and error
- getPhoto(with identifier: String, mode: PHImageRequestOptionsDeliveryMode) -> UIImage?
Returns a photo with the specific identifier
- containsPhoto(identifier: String) -> Bool
Returns a boolean value indicating whether the photo exists in photo library
- deletePhoto(identifier: String)
Deleting the photo with the specific identifier
作者
tdermaris, [email protected]
授权
PhotoLibraryManager 在 MIT 授权下提供。有关更多信息,请参阅 LICENSE 文件。