A Custom Class to select media from camera ,video or photo library .
Just Drag and Drop MJMediaPicker class into your project and you are done.You can download and run the demo app for refrence.
How to use:
- If you need to capture image from Camera
MJMediaPicker.sharedInstance.openCamera(self, isVideo: false, showVideoOption: true) { (aImg, videoUrl, selectedType) in
//Perform your work accordingly
}
- If you need to capture video
MJMediaPicker.sharedInstance.openCamera(self, isVideo: true, showVideoOption: true) { (aImg, videoUrl, selectedType) in
//Perform your work accordingly
}
- If you need to choose media from photo library
MJMediaPicker.sharedInstance.chooseImageFromGallery(viewController: self) { (aImg, videoUrl, selectedType) in
//Perform your work accordingly
}
default:
MJMediaPicker.sharedInstance.showCameraVideoActionSheeet(self, showVideo: true) { (aImg, videoUrl, selectedType) in
//Perform your work accordingly
}