I'm working on a KMM application with a video picking feature. For the iOS implementation, I'm using a PHPickerViewController
. The view controller is well presented but I don't know how to handle the callback param didFinishPicking
from PHPickerViewControllerDelegateProtocol
.
My goal is to extract the byte array from the file given by picker
Here's my WIP:
private val delegate = object : NSObject(), PHPickerViewControllerDelegateProtocol,
UINavigationControllerDelegateProtocol {
override fun picker(picker: PHPickerViewController, didFinishPicking: List<*>) {
// TODO extract the byte array form the file referenced in the picker param
picker.dismissViewControllerAnimated(flag = false) {}
}
}