Hi,
I have a little issue with this new API PHPPickerViewController:
This code above doesn't work, I don't get the URL at all. I tried on Simulator and real device but the same problem. I tried loadObject function but I can't the UIImages...
I saw some workarounds here but they don't work in my case it seems...
I have a little issue with this new API PHPPickerViewController:
Code Block var configuration = PHPickerConfiguration() configuration.filter = .any(of: [.images]) configuration.selectionLimit = 10 configuration.preferredAssetRepresentationMode = .compatible let picker = PHPickerViewController(configuration: configuration) picker.delegate = self present(picker, animated: true, completion: nil)
Code Block func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { var selectedPhotosData : [Data] = [] for (index,result) in results.enumerated() { result.itemProvider.loadFileRepresentation(forTypeIdentifier: "public.jpeg") { (url, error) in guard let fileUrl = url else {return } print(fileUrl) } }
This code above doesn't work, I don't get the URL at all. I tried on Simulator and real device but the same problem. I tried loadObject function but I can't the UIImages...
I saw some workarounds here but they don't work in my case it seems...