gpt4 book ai didi

ios - swift 3 中的调度队列显示为未解析的标识符

转载 作者:可可西里 更新时间:2023-11-01 03:28:20 25 4
gpt4 key购买 nike

<分区>

我正在尝试在主线程上异步拍摄/录制视频。然而,当我调用 dispatch.main.async 时,我总是得到错误:

use of unresolved identifier DispatchQueue

从 WWDC 到 Apple 的文档,我到处都看过,但没有看到任何类型被弃用的证据。

代码如下:

   if !self.cameraEngine.isRecording {
if let url = CameraEngineFileManager.temporaryPath("video.mp4") {
self.cameraButton.setTitle("stop recording", forState: [])
self.cameraEngine.startRecordingVideo(url, blockCompletion: { (url: NSURL?, error: NSError?) -> (Void) in
if let url = url {

DispatchQueue.main.async {
self.cameraButton.setTitle("start recording", for: .normal)
CameraEngineFileManager.saveVideo(url, blockCompletion: { (success: Bool, error: Error?) -> (Void) in
if success {
let alertController = UIAlertController(title: "Success, video saved !", message: nil, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
self.present(alertController, animated: true, completion: nil)
}
})
}
}
})
}
}
else {
self.cameraEngine.stopRecordingVideo()
}
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com