| On some devices, when i select the same media multiple times, the data by` loadFileRepresentation(forTypeIdentifier: completionHandler) ` returned is different(data.count is not equal). |
| |
| environment: |
| * Model: iPhone 12 |
| * Model Number: MGGM3CH/A |
| * iOS Version: 18.3.2 |
| |
| ```Swift |
| |
| func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) { |
| picker.dismiss(animated: true, completion: nil) |
| guard let provider = results.last?.itemProvider else { return } |
| |
| guard provider.hasItemConformingToTypeIdentifier(UTType.movie.identifier) else { |
| return |
| } |
| |
| Task { |
| provider.loadFileRepresentation(forTypeIdentifier: UTType.movie.identifier) { url, error in |
| guard let url = url else { |
| return |
| } |
| |
| if let data = try? Data(contentsOf: url) { |
| print("data count is: \(data.count)") |
| } |
| } |
| } |
| } |
| ``` |
| |
| ps: I also try some other function, eg: ` provide.loadItem(forTypeIdentifier:)`, but not work too. |