Anyone know if it is possible to use AVCaptureDevice.DiscoverySession to detect any Camera or Mic connected without just going through each of the different types, checking for them, and appending them to an array?
For instance, the way I used to detect connected cameras or microphones was with a for loop like this, but now that way of doing it is deprecated and I'm curious if there is a solution with their new AVCaptureDevice.DiscoverySession method.
//THE OLD WAY WAS LIKE:
for eachDevice in AVCaptureDevice.devices() {print(eachDevice)}
//THE NEW WAY IS LIKE:
let discoverFrontFacingWideAngleCamerasConnected = AVCaptureDevice.DiscoverySession.init(deviceTypes: [.builtInWideAngleCamera], mediaType: .video, position: .front)
for device in discoverFrontFacingWideAngleCamerasConnected.devices {
print("there is a front facing wide angle camera named -> \(device.localizedName)")
}
//BUT HOW CAN I ??
let allCamerasAndMicrophonesConnected = AVCaptureDevice.DiscoverySession.init(ANY CAMERAS OR MICS)