twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.02k stars 293 forks source link

Starting and stopping capture session blocks UI thread #31

Closed breyed closed 2 years ago

breyed commented 3 years ago

The calls to start and stop the capture session are blocking and should be called on a background thread, like this:

DispatchQueue.global(qos: .userInitiated).async {
    self.captureSession.startRunning()
}
twostraws commented 2 years ago

Fixed – thank you!