func previewRecording (withFileName fileURL: String) {
if UIVideoEditorController.canEditVideo(atPath: fileURL) {
let rootView = UIApplication.getTopMostViewController()
let editController = UIVideoEditorController()
editController.videoPath = fileURL
// editController.delegate = ?????
rootView?.present(editController, animated: true, completion: nil)
} else {
}
}
^ current code
I have gone around the internet in circles a few times trying to figure this out. What would be the best approach for specifying a delegate for the UIVideoEditorController here? This is a react-native module where there is no ViewController, just utility classes.
Some simple example code I have come across
extension SomeViewController :
UIVideoEditorControllerDelegate,
UINavigationControllerDelegate {
func videoEditorController(_ editor: UIVideoEditorController,
didSaveEditedVideoToPath editedVideoPath: String) {
print("saved!")
}
}
I am just loss about how to make this happen in my module though.