拍照后如何暂停?

How to put a pause after taking a picture?

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

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

    // show picture, or any pause content

    Timer.scheduledTimer(withTimeInterval: <#SecondsYouWantToWait#>, repeats: false) { (_) in
         // move on
    }

按下按钮后暂停:

self.videoPreviewLayer.connection?.isEnabled = false

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

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