Home » Swift » UIImagePickerController stuck on compressing video on iOS10 simulator after choosing a video

UIImagePickerController stuck on compressing video on iOS10 simulator after choosing a video

Posted by: admin January 4, 2018 Leave a comment

Questions:

I had this app that always worked normally on iOS9, now I’ve migrated the swift code to 3.0 and added the required plist rows to get access to photos library.
While trying to pick a video (preloaded by dragging) from the camera roll using UIImagePickerControlleron simulator it always get stuck on “Compressing Video” and doesn’t callback the delegate methods.

   @IBAction func videoFromLibrary(_ sender: UIBarButtonItem) {
        picker.allowsEditing = false
        picker.sourceType = .photoLibrary
        picker.mediaTypes = UIImagePickerController.availableMediaTypes(for: .photoLibrary)!
        picker.modalPresentationStyle = .popover
        present(picker, animated: true, completion: nil)
        picker.popoverPresentationController?.barButtonItem = sender
    }

Using a real device it works fine, it really seems to be an Apple bug, I’m wondering if anyone had this issue or I’m missing something to make UIImagePickerController work again correctly using videos on simulator (or if there is a workaround).

Answers:

I was having this same problem running it on the iPhone 7 Plus simulator but it seems to dismiss when I run it on an iPhone 6s Plus simulator. Maybe a bug in the simulator.

Questions:
Answers:

I ran into the same problem for iOS 10 for Xcode 8 and iPad Pro 12.9in Simulator.

If you use iPad Pro 9.7in Simulator then it works. Good god Apple, get your act straight!