When I use PHPickerViewController to let the user choose a photo, and I run my app in the Simulator, there is some issue with just the first photo in the library. If the user chooses that photo and we say
we are told that the registered type identifiers are ["public.jpeg", "public.heic"], and then when we ask for UIImage we get an error: "The file ... couldn’t be opened because there is no such file." And the resulting UIImage is nil.
The problem arises only for this one photo, and it is the only one with an HEIC representation. Is there some issue with photos that have an HEIC representation? How are we supposed to retrieve the image for these?
(The same code works just fine on a device. The issue arises only on the Simulator. I'm using the latest Xcode 12.2 beta.)
Code Block guard let result = results.first else { return } let prov = result.itemProvider print(prov.registeredTypeIdentifiers) prov.loadObject(ofClass: UIImage.self) { (result, err) in print(result) }
we are told that the registered type identifiers are ["public.jpeg", "public.heic"], and then when we ask for UIImage we get an error: "The file ... couldn’t be opened because there is no such file." And the resulting UIImage is nil.
The problem arises only for this one photo, and it is the only one with an HEIC representation. Is there some issue with photos that have an HEIC representation? How are we supposed to retrieve the image for these?
(The same code works just fine on a device. The issue arises only on the Simulator. I'm using the latest Xcode 12.2 beta.)