ios - 拍照后如何暂停?

标签 ios swift avcapturephotooutput

我正在使用 AVCapturePhotoOutput 通过单击按钮进行捕获。我检查了内置摄像头,发现摄像头拍照时会稍微停顿一下。

我如何使用 AVCapturePhotoOutput 做到这一点?

最佳答案

按下按钮后暂停:

self.videoPreviewLayer.connection?.isEnabled = false

并稍微延长暂停时间并取消暂停:

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
    self.videoPreviewLayer.connection?.isEnabled = true
})

关于ios - 拍照后如何暂停?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53408259/

相关文章:

ios - 调用计时器以快速更新路径

iphone - 循环计数器 - 最短方法

ios - 文本在容器中无法正确显示(swift 3.0)

ios - AVCapturePhotoOutput 崩溃

ios - 如何在父 View 中获取子 UIView 的索引?

ios - 嵌入在 UITableViewCell 中的 UICollectionView 内的 UICollectionViewCell 被重复

ios - 需要在 Swift 中点击一下来停止密集型功能

ios - 如何在 Swift 中使用 plist 中的值而不将它们作为 AnyObject 出现?

ios - 如何从相机图像中获取深度数据