TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Aug 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Meniny.
Peking
is a tiny image picker library.
You are welcome to fork and submit pull requests.
Peking
is open-sourced software, licensed under the MIT
license.
import Peking
class ViewController: UIViewController, PekingDelegate {
// ...
func picking(_ sender: AnyObject) {
let peking = PekingController(mode: .library, multipleSelection: true, delegate: self)
self.present(peking, animated: true, completion: nil)
}
// MARK: PekingDelegate Protocol
func peking(_ peking: PekingController, didSelectImages images: [PekingImage]) {
print("Number of selection images: \(images.count)")
peking.dismiss(animated: true, completion: nil)
}
func peking(_ peking: PekingController, didCaptureVideo videoURL: URL) {
print("video completed and output to file: \(videoURL)")
peking.dismiss(animated: true, completion: nil)
}
func peking(_ peking: PekingController, didCapturePhoto photo: UIImage) {
self.imageView.image = photo
peking.dismiss(animated: true, completion: nil)
}
func pekingCameraRollUnauthorized(_ peking: PekingController) {
peking.dismiss(animated: true, completion: nil)
print("Camera roll unauthorized")
}
func pekingDidDismiss(_ peking: PekingController) {
print("Called when the PekingController dismissed")
}
func pekingWillDismiss(_ peking: PekingController) {
print("Called when the close button is pressed")
}
}