0

After immigrating Swift 4 following function has been stopped being called. I could not find the reason.

  func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) {

        Code

 }
Hope
  • 2,096
  • 3
  • 23
  • 40

1 Answers1

0

After making Xcode 9 making suggestion by starting writing function

      func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {

   code

}

Suggested and I replaced

            func captureOutput(_ captureOutput: AVCaptureOutput!, didOutputSampleBuffer sampleBuffer: CMSampleBuffer!, from connection: AVCaptureConnection!) {

with

           func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {

Now, it has been called.

Hope
  • 2,096
  • 3
  • 23
  • 40
  • The unusual thing was not working function has been excepted even if it was not written in proper format for Swift4. – Hope Sep 30 '17 at 09:26