Vote count:
0
I'm new to app developing so this may be a trivial question but please HELP!!
I am trying to save a video to the Camera Roll using the UIImagePickerController class. So far I have been successful pulling up the camera and saving an image. I have also been able to record video, but when I press "use video" it does not save to the camera roll.
Below is the attached didFinishPickingMediaWithInfo function.
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) { let mediaType = info[UIImagePickerControllerMediaType] as NSString
self.dismissViewControllerAnimated(true, completion: nil)
if mediaType.isEqualToString(kUTTypeImage as NSString)
{
let image = info[UIImagePickerControllerOriginalImage] as UIImage
if (newMedia == true)
{
UIImageWriteToSavedPhotosAlbum(image, self, "image:didFinishSavingWithError:contextInfo:", nil)
}
else if mediaType.isEqualToString(kUTTypeMovie as NSString)
{
let videoPath = info[UIImagePickerControllerMediaURL] as NSString
if(newMedia == true)
{
UISaveVideoAtPathToSavedPhotosAlbum(videoPath, self,
"image:didFinishSavingWithError:contextInfo:", nil)
}
}
}
}
asked 8 mins ago
saving video; using UIImagePickerController; IOS 8 Swift
Aucun commentaire:
Enregistrer un commentaire