Merge pull request #7 from TouchInstinct/fix/session_preset_fix

Session preset support check fixed
This commit is contained in:
Vladimir Makarov 2021-12-15 23:09:42 +05:00 committed by GitHub
commit f6a8c19e19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'QRCodeReader'
s.version = '1.0.6'
s.version = '1.0.7'
s.summary = 'iOS framework contain core view elements and logic component for work with QR codes.'
s.homepage = 'https://github.com/TouchInstinct/QRCodeReader-ios'

View File

@ -143,10 +143,9 @@ open class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegate {
// MARK: - Private Methods
private func configureDefaultComponents() {
if session.canSetSessionPreset(.hd4K3840x2160) {
if let defaultDevice = defaultDevice,
defaultDevice.supportsSessionPreset(.hd4K3840x2160) {
session.sessionPreset = .hd4K3840x2160
} else {
session.sessionPreset = .photo
}
for output in session.outputs {