-
Notifications
You must be signed in to change notification settings - Fork 753
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
Adds support for using the Ultra Wide (macro) camera #582
base: master
Are you sure you want to change the base?
Conversation
Bump the target iOS version to 13 to allow more easily using the UltraWide camera.
Adds an option to request using the Ultra Wide camera if available for better macro support. This adds the tryUseUltraWideCamera flag on ZXCapture to try to use the Ultra Wide if available. If not available, the Wide camera will be used instead. This flag must be set before you set the camera property, in order for it to properly take effect.
Apple recommends calling startRunning on a background thread as it can block the UI, so we move the dispatch of it to a separate thread to improve performance and remove the warning.
Ultra wide camera definition is not available on OS X so make the new changes conditional.
Hi @dpolivy I am open to merge that one and release a new version. I find that one genuinely helpful. Two remarks:
Thanks for the changes! |
Hi @benjohnde, I can fix up the Podspec URL. On iOS 13, I have to ask, is there really any valid reason to support anything less than iOS 13 at this point? Looking at this chart (https://iosref.com/ios) you only really lose iPhone 6/6Plus and some older iPads that can't support iOS 13. One point of documentation I should add to this PR is that the ultra wide camera only seems to really work for barcode scanning on iPhone 13 Pro/Pro Max and higher Pro/Pro Max models. Other models with an ultra wide camera don't seem to work very well based on my testing. I "hacked" this into my app logic that uses this library, and it might be useful for future consumers to know this. (Originally my logic enabled ultra wide if it existed, but it caused 11 Pro/12 Pro devices to not be able to scan anything.) |
Appreciate your comment and work. This library is fairly old and if there is a way to stay at the minimum supporting level without sacrificing the support of newer devices, I would rather add a few lines, although I agree that probably a minority at max will benefit from that. |
I realize this repo is essentially dead, but I am opening this PR in the hopes that others may find it useful. We've had a lot of reports of users on modern iPhones having trouble scanning barcodes because the camera won't focus close-in. To address this, I've added a flag that will tell the library to try to use the ultra wide camera if available. If not, it will fall back to the regular wide camera.
I also updated the minimum iOS version to 13 to make it easier to add this code.
If you don't want to mess around with forks and want to consume this, I have a private Podspec repo available here that you can reference the Cocoapod from: