react-native-vision-camera/ios/Extensions/AVCaptureDevice+physicalDevices.swift
Marc Rousavy 9ea158ad8f
chore: Move to /mrousavy/ (#224)
* rename 1/n

* 2

* 3

* fix indent
2021-06-21 22:42:46 +02:00

23 lines
531 B
Swift

//
// AVCaptureDevice+physicalDevices.swift
// mrousavy
//
// Created by Marc Rousavy on 10.01.21.
// Copyright © 2021 mrousavy. All rights reserved.
//
import AVFoundation
extension AVCaptureDevice {
/**
If the device is a virtual multi-cam, this returns `constituentDevices`, otherwise this returns an array of a single element, `self`
*/
var physicalDevices: [AVCaptureDevice] {
if #available(iOS 13.0, *), isVirtualDevice {
return self.constituentDevices
} else {
return [self]
}
}
}