My use case is simply and I wanted the external camera or no camera. I should get back to it soon. To answer your issue the line of code that is added is
AVCaptureDevice.self.addObserver(self, forKeyPath: "systemPreferredCamera", options: [.new], context: &systemPreferredCameraContext)
You need to add the following property to your class
var systemPreferredCameraContext: AVCaptureDevice? = AVCaptureDevice.systemPreferredCamera
Hope that is what you are asking about.