Latest 0.0.2
Homepage https://github.com/ducn/DNImagePicker
License MIT
Platforms ios 8.0
Dependencies ICGVideoTrimmer
Frameworks UIKit
Authors

A replacement of UIImagePickerController with additional trim/crop square video supported!.
Thanks for WDImagePicker & ICGVideoTrimmer

Install

use_frameworks!

pod 'DNImagePicker'

Usage

let imagePicker = DNImagePicker()
// Setup media types
imagePicker.mediaTypes = [kUTTypeMovie as String, kUTTypeImage as String]
// Setup trim length for video
imagePicker.maxTrimLength = 30 //seconds
imagePicker.minTrimLength = 15 //seconds
imagePicker.delegate = self

self.presentViewController(imagePicker, animated: true, completion: nil)

And received image/video via delegates exactly the same as UIImagePickerController protocol

func imagePickerControllerDidCancel(_ picker: DNImagePickerController) {

}

func imagePickerController(_ picker: DNImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
    if let videoUrl = info[UIImagePickerControllerMediaURL] as? URL {
        // Receive video url here
    }
    else if let image = info[UIImagePickerControllerOriginalImage] as? UIImage {
        // Receive image here
    }
}

Screenshot

Trim/crop video screen:

DNImagePicker

Crop photo screen:

DNImagePicker

License

MIT

Latest podspec

{
    "name": "DNImagePicker",
    "version": "0.0.2",
    "summary": "A replacement of UIImagePickerController with additional trim/crop video supported!",
    "description": "Use DNImagePickerController when you want to pick user photo or video with trim/crop square video supported",
    "homepage": "https://github.com/ducn/DNImagePicker",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Duc Ngo": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "frameworks": "UIKit",
    "dependencies": {
        "ICGVideoTrimmer": []
    },
    "source": {
        "git": "https://github.com/ducn/DNImagePicker.git",
        "tag": "0.0.2"
    },
    "source_files": [
        "DNImagePicker/Classes",
        "DNImagePicker/Classes/*.swift",
        "DNImagePicker/Classes/**/*.swift"
    ],
    "resource_bundles": {
        "DNImagePicker": [
            "DNImagePicker/**/*.{png,jpeg,jpg,storyboard,xib,strings}"
        ]
    },
    "pushed_with_swift_version": "3.0.1"
}

Pin It on Pinterest

Share This