func photoOutput()

in HuggingSnap/Camera/CameraManager.swift [315:329]


    func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
        if let error = error {
            set(error: .photo(error))
            return
        }
        
        guard let imageData = photo.fileDataRepresentation() else {
            set(error: .photo(NSError(domain: "CameraError", code: -1, userInfo: [NSLocalizedDescriptionKey: "Could not create image data"])))
            return
        }
        
        DispatchQueue.main.async {
            self.photo = imageData
        }
    }