Skip to content
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

"Call can throw, but it is not marked with 'try' and the error is not handled" when trying to access ultrawide camera on iPad Pro #238

Open
nikhilrama opened this issue Dec 11, 2020 · 1 comment
Labels

Comments

@nikhilrama
Copy link

nikhilrama commented Dec 11, 2020

I am attempting to access the iPad Pro's ultra-wide angle camera with ARCamera. I have made the following modifications to the original files and am getting an error when trying to build.

NextLevel.swift: added ultrawideangle camera case to enum list and AVCaptureDevice.DeviceType

NextLevel+AVFoundation.swift: Modified the primaryVideoDevice method as instructed here: #187

ViewController.swift: added this line: nextLevel.changeCaptureDeviceIfAvailable(captureDevice: .ultraWideAngleCamera) to the video configuration area within the setupCamera() function. This is where I am getting the error. Any advice on how to resolve + actually access the ultrawide cam would be appreciated.

@rogerluan
Copy link

Simply add try (or try? or try!, depending on your use case) in front of the method invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants