Sta*_*nov 5 ios uivideoeditorcontroller swift
我正在使用UIVideoEditorController,但是成功委托方法为我调用了两次。但是,所有传递的对象的所有指针都告诉它发送完全相同的数据。
let editor = UIVideoEditorController()
editor.videoMaximumDuration = 10.0
editor.videoQuality = .typeIFrame1280x720
editor.delegate = self
editor.videoPath = // some path goes here
self.present(editor, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
然后,以下方法将“ here”打印两次。
func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) {
print("here")
self.dismiss(animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)
小智 5
func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) {
editor.delegate = nil
editor.dismiss(animated: true)
}
Run Code Online (Sandbox Code Playgroud)
小智 1
是的,我知道,这是不好的方式,但工作:)
var isSaved:Bool = false
func videoEditorController(_ editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) {
if(!isSaved) {
print("here")
self.isSaved = true
}
self.dismiss(animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
479 次 |
| 最近记录: |