Compare commits
8 Commits
feature/ca
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
f6a8c19e19 | |
|
|
d0937c42a5 | |
|
|
b1f649ec68 | |
|
|
03ea77b113 | |
|
|
8a60b59c62 | |
|
|
3ab48fced3 | |
|
|
446b08f78a | |
|
|
3bf635e857 |
|
|
@ -1,6 +1,6 @@
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'QRCodeReader'
|
s.name = 'QRCodeReader'
|
||||||
s.version = '1.0.4'
|
s.version = '1.0.7'
|
||||||
s.summary = 'iOS framework contain core view elements and logic component for work with QR codes.'
|
s.summary = 'iOS framework contain core view elements and logic component for work with QR codes.'
|
||||||
s.homepage = 'https://github.com/TouchInstinct/QRCodeReader-ios'
|
s.homepage = 'https://github.com/TouchInstinct/QRCodeReader-ios'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,8 @@ open class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegate {
|
||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
|
configureDefaultDevice()
|
||||||
|
|
||||||
sessionQueue.async {
|
sessionQueue.async {
|
||||||
self.configureDefaultComponents()
|
self.configureDefaultComponents()
|
||||||
}
|
}
|
||||||
|
|
@ -141,6 +143,10 @@ open class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegate {
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
|
|
||||||
private func configureDefaultComponents() {
|
private func configureDefaultComponents() {
|
||||||
|
if let defaultDevice = defaultDevice,
|
||||||
|
defaultDevice.supportsSessionPreset(.hd4K3840x2160) {
|
||||||
|
session.sessionPreset = .hd4K3840x2160
|
||||||
|
}
|
||||||
|
|
||||||
for output in session.outputs {
|
for output in session.outputs {
|
||||||
session.removeOutput(output)
|
session.removeOutput(output)
|
||||||
|
|
@ -160,6 +166,28 @@ open class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegate {
|
||||||
|
|
||||||
session.commitConfiguration()
|
session.commitConfiguration()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func configureDefaultDevice() {
|
||||||
|
guard let device = defaultDevice else { return }
|
||||||
|
|
||||||
|
do {
|
||||||
|
try device.lockForConfiguration()
|
||||||
|
|
||||||
|
if device.isAutoFocusRangeRestrictionSupported {
|
||||||
|
device.autoFocusRangeRestriction = .near
|
||||||
|
}
|
||||||
|
|
||||||
|
if device.isFocusModeSupported(.continuousAutoFocus) {
|
||||||
|
device.focusMode = .continuousAutoFocus
|
||||||
|
}
|
||||||
|
|
||||||
|
if device.isLowLightBoostSupported {
|
||||||
|
device.automaticallyEnablesLowLightBoostWhenAvailable = true
|
||||||
|
}
|
||||||
|
|
||||||
|
device.unlockForConfiguration()
|
||||||
|
} catch _ { }
|
||||||
|
}
|
||||||
|
|
||||||
// MARK: - AVCaptureMetadataOutputObjectsDelegate
|
// MARK: - AVCaptureMetadataOutputObjectsDelegate
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue