Peking 1.1.0

Peking 1.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Meniny.



Peking 1.1.0

  • By
  • Elias Abel

Peking

What’s this?

Peking is a tiny image picker library.

Preview

59834b3c5d654.jpg

59834b4a7058a.jpg

59834b5031654.jpg

Requirements

  • iOS 8.0+
  • Xcode 8 with Swift 3

Contribution

You are welcome to fork and submit pull requests.

License

Peking is open-sourced software, licensed under the MIT license.

Usage

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")
    }
}