CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

EasyImageVideoPicker 0.1.1

EasyImageVideoPicker 0.1.1

Maintained by Avijit Babu.



EasyImageVideoPicker

CI Status Version License Platform

Example

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

Requirements

This will run on iOS 12.0 and above devices.

Installation

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

pod 'EasyImageVideoPicker'

Usage

Import this framework and initialize it first. Don't forget to set your UsageDescription in your info.plist

var imgPicker : EasyImageVideoPicker?

Set an object to that from your view controller and also set delegate for

imgPicker = EasyImageVideoPicker(presentationController: self, delegate: self)

Show alert or options from your button action

@IBAction func pickImage(_ sender : UIButton){
    imgPicker?.present(from: sender, mediaType: .images, onViewController: self)
}

Now pick image and video url from that delegate protocol.

extension ViewController : EasyImageVideoPickerDelegate{

    func didSelect(image: UIImage?, video: URL?, fileName: String?) {
        //For image picker
        img.image = image
        //For video picker
        print("This is my video name" + (fileName ?? ""))
        print("This is my video url" + (video?.description ?? ""))
    }
    
}

Author

Avijit Babu, [email protected]

License

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