- This is very simple and light photo browser written swift. and also you can show images or videos.
Supports iOS 9.0+, Swift 3.0
To run the example project, clone the repo, and run pod install
from the Example directory first.
CSPhotoGallery is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "CSPhotoGallery"
First Step - @import CSPhotoGallery
to your project
Second Step - Add a delegate CGPhotoGalleryDelegate
to your class & add two delegate methods
func getAssets(assets: [PHAsset]) {
// if you implement this delegate function, you will receive assets
}
func dismiss() {
// Photo browser dismiss
// ex)
// dismiss(animated: true) {
// do something
// }
}
Third Step - Present a CSPhotoGalleryViewController
let vc = CSPhotoGalleryViewController.instance
vc.delegate = self
vc.CHECK_MAX_COUNT = 20
vc.horizontalCount = 3
vc.mediaType = .image // or .video
present(vc, animated: true)
And you can customize ui design
let designManager = CSPhotoDesignManager.instance
designManager.photoDetailBackButtonImage
designManager.photoDetailOKButtonTitle
designManager.photoDetailCheckImage
designManager.photoDetailUnCheckImage
designManager.photoGalleryBackButtonImage
designManager.photoGalleryOKButtonTitle
designManager.photoGalleryCheckImage
designManager.photoGalleryUnCheckImage
chansim.youk, [email protected]
CSPhotoGallery is available under the MIT license. See the LICENSE file for more info.