iosswiftavcapturephotooutput

How to put a pause after taking a picture?


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?


Solution

  • 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
    })