PhotoLibraryManager helps you ask user permission to access photo library and provides several methods to add new folder, save and delete images etc.
To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 10 and above.
PhotoLibraryManager is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'PhotoLibraryManager'
import PhotoLibraryManager
let photoManager = PhotoLibraryManager()
use the below functions on photoManager to get the functionality that you want
PhotoLibraryManager provides the following public methods:
- 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)
Deletes the photo with the specific identifier
tdermaris, tdermaris@gmail.com
PhotoLibraryManager is available under the MIT license. See the LICENSE file for more info.