Skip to content

Commit d8f10d9

Browse files
author
Nathan Fallet
authored
Merge pull request #100 from twostraws/fix/shutter-noises
2 parents 88a6132 + d016ea4 commit d8f10d9

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Sources/CodeScanner/ScannerViewController.swift

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,12 @@ extension CodeScannerView {
491491

492492
@available(macCatalyst 14.0, *)
493493
extension CodeScannerView.ScannerViewController: AVCapturePhotoCaptureDelegate {
494-
public func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
494+
495+
public func photoOutput(
496+
_ output: AVCapturePhotoOutput,
497+
didFinishProcessingPhoto photo: AVCapturePhoto,
498+
error: Error?
499+
) {
495500
isCapturing = false
496501
guard let imageData = photo.fileDataRepresentation() else {
497502
print("Error while generating image from photo capture data.");
@@ -502,5 +507,20 @@ extension CodeScannerView.ScannerViewController: AVCapturePhotoCaptureDelegate {
502507
return
503508
}
504509
handler?(qrImage)
505-
}
510+
}
511+
512+
public func photoOutput(
513+
_ output: AVCapturePhotoOutput,
514+
willCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings
515+
) {
516+
AudioServicesDisposeSystemSoundID(1108)
517+
}
518+
519+
public func photoOutput(
520+
_ output: AVCapturePhotoOutput,
521+
didCapturePhotoFor resolvedSettings: AVCaptureResolvedPhotoSettings
522+
) {
523+
AudioServicesDisposeSystemSoundID(1108)
524+
}
525+
506526
}

0 commit comments

Comments
 (0)