UIImpactFeedbackGenerator Not Working When Audio Device Added to AVCaptureSession

Adding microphone audio input to AVCaptureSession seem to disable UIImpactFeedbackGenerator.


let audioDevice = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeAudio)
let audioDeviceInput = try AVCaptureDeviceInput(device: audioDevice) 
if self.session.canAddInput(audioDeviceInput) { 
   self.session.addInput(audioDeviceInput)
 }


Once the audio device is removed, feedback seems to resume.


Is this normal behavior? Is there a way around this?


I notice stock iOS Camera app in video mode and long pressing on thumbnail seem to still make the feedback work. So there has to be a way around this?