I'm using UIPickerViewController to select images and video from the device camera roll.
When I select videos I would like to pick a video of maximum 10 seconds, and if longer to give the possibility for the user to trim it.
Until now I've searched online and did this, but it doesn't seem to work:
let imagePickerController = UIImagePickerController()
imagePickerController.videoMaximumDuration = 10.0
imagePickerController.mediaTypes = ["public.image", "public.movie"]
imagePickerController.delegate = self
self.present(imagePickerController, animated: true, completion: nil)
I found the solution, everything you need to do is to add this line before presenting: