TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jan 2017 |
SwiftSwift Version | 3 |
SPMSupports SPM | ✗ |
Maintained by CSPhotoGallery.
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
public class CSPhotoDesignManager {
public static var instance: CSPhotoDesignManager = CSPhotoDesignManager()
// Photo collection view
public var photoGalleryBackButtonImage: UIImage?
// Photo detail view
public var photoDetailBackButtonImage: UIImage?
// OK Button Title
public var photoGalleryOKButtonTitle: String?
// Check Image
public var photoGalleryCheckImage: UIImage?
// UnCheck Image
public var photoGalleryUnCheckImage: UIImage?
// When OK Button is hidden, CheckCountLabel and CheckBtn is hidden
public var isOKButtonHidden = false
}
chansim.youk, [email protected]
CSPhotoGallery is available under the MIT license. See the LICENSE file for more info.