-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Value of type '[AVCaptureDevice]' has no member 'compactMap' #4
Comments
Updated to Swift 4.1, error is gone but getting cameras as anempty array. |
Try to replace: let session = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInDualCamera], mediaType: AVMediaType.video, position: .unspecified) By: let session = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera], mediaType: AVMediaType.video, position: .unspecified) |
Still getting the same error... |
Could someone one please help... THANKYOU in advance.. |
Try to use something like this. |
@sri1sri generic instance method compactMap seems to be supported from iOS 7.0+ and compatible with Xcode 9.3+ . What is the SDK version you are targeting and Xcode version you are using ? |
|
let cameras = session.devices.compactMap { $0 }
- error on this lineThe text was updated successfully, but these errors were encountered: