How to put a pause after taking a picture?

125 views Asked by At

I'm using AVCapturePhotoOutput to capture with a button click. I checked the built-in camera and found that when camera takes a picture it somewhat pause for a bit.

How can I do that using AVCapturePhotoOutput?

2

There are 2 answers

0
jay123456 On BEST ANSWER

To make a pause after pressing the button:

self.videoPreviewLayer.connection?.isEnabled = false

And to prolong the pause a lil bit and unpause:

DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
    self.videoPreviewLayer.connection?.isEnabled = true
})
0
Gustavo Vollbrecht On
    // show picture, or any pause content

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