Fixing the duplicated scan #127
This commit is contained in:
parent
f63c569eda
commit
e969a4c5c7
|
@ -191,19 +191,19 @@ public final class QRCodeReader: NSObject, AVCaptureMetadataOutputObjectsDelegat
|
||||||
*Notes: if `stopScanningWhenCodeIsFound` is sets to true (default behaviour), each time the scanner found a code it calls the `stopScanning` method.*
|
*Notes: if `stopScanningWhenCodeIsFound` is sets to true (default behaviour), each time the scanner found a code it calls the `stopScanning` method.*
|
||||||
*/
|
*/
|
||||||
public func startScanning() {
|
public func startScanning() {
|
||||||
if !session.isRunning {
|
sessionQueue.async {
|
||||||
sessionQueue.async {
|
guard !self.session.isRunning else { return }
|
||||||
self.session.startRunning()
|
|
||||||
}
|
self.session.startRunning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Stops scanning the codes.
|
/// Stops scanning the codes.
|
||||||
public func stopScanning() {
|
public func stopScanning() {
|
||||||
if session.isRunning {
|
sessionQueue.async {
|
||||||
sessionQueue.async {
|
guard self.session.isRunning else { return }
|
||||||
self.session.stopRunning()
|
|
||||||
}
|
self.session.stopRunning()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue