I use loadFileRepresentation(forTypeIdentifier:completionHandler:)
to load video
with PHPickerViewController
What can I use load video with?
// my sample code
func loadPhoto(pickerItem: PhotosPickerItem) async throws -> Photo {
if let livePhoto = try await pickerItem.loadTransferable(type: PHLivePhoto.self) {
let photo: Photo = .init(id: pickerItem.itemIdentifier, item: livePhoto)
return photo
} else if let url = try await pickerItem.loadTransferable(type: URL.self) {
let photo: Photo = .init(id: pickerItem.itemIdentifier, item: url)
return photo
} else if let data = try await pickerItem.loadTransferable(type: Data.self) {
let photo: Photo = .init(id: pickerItem.itemIdentifier, item: data)
return photo
}
throw PhotoError.load
}
This problem fixed in iOS 16 beta 5. thanks