Latest 1.1.0
Homepage https://github.com/jamalalayq/EasyImagePicker
License MIT
Platforms ios 10.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

EasyImagePicker is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'EasyImagePicker'

Usage


import UIKit
import EasyImagePicker

class ViewController: UIViewController {

    private var imagePicker: ImagePicker?,
    setting = Tuning.init()

    @IBOutlet private weak var imageView: UIImageView!

    internal override func viewDidLoad() {
        super.viewDidLoad()

        setting.type = .picture
        setting.screen = self
        imagePicker = ImagePicker.init()
        imagePicker?.onCancel = {
            debugPrint("picking canceled by user!")
        }
        imagePicker?.onError = {
            debugPrint("error occurred!")
        }
        imagePicker?.onPickImage = { [weak self] (pickedIamge, picker) in
            let reducedImage = picker.reduce(this: pickedIamge, to: 0.50) ?? .init()
            let sizedImage = picker.resize(this: reducedImage, by: CGSize(width: 200, height: 200))
            self?.imageView.image = sizedImage
        }                       
    }

    @IBAction private func pickImageOnClick(_ sender: UIButton) {
        switch sender.tag {
            case 0:
                setting.mode = .default
                imagePicker?.pick(with: setting)
            case 1:
                setting.mode = .custom(.camera)
                imagePicker?.pick(with: setting)
            case 2:
                setting.mode = .custom(.library)
                imagePicker?.pick(with: setting)
            default:
                break
        }
    }

}

Author

Jamal, [email protected]

License

EasyImagePicker is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "EasyImagePicker",
    "version": "1.1.0",
    "swift_version": "5.0",
    "summary": "picking image quickly.",
    "description": "Sample swift class save time and effort when picking images.",
    "homepage": "https://github.com/jamalalayq/EasyImagePicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Jamal": "[email protected]"
    },
    "source": {
        "git": "https://github.com/jamalalayq/EasyImagePicker.git",
        "tag": "1.1.0"
    },
    "social_media_url": "https://twitter.com/jamalelayeq",
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "EasyImagePicker/Classes/**/*"
}

Pin It on Pinterest

Share This