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

Fixes a crash when there is only one capture session connection available #10

Closed damirstuhec closed 4 years ago

damirstuhec commented 4 years ago

This line assumes there are always two capture session connections available, which is not always true, resulting in a crash.

This PR fixes the issue by taking the last connection, and setting the orientation on it if the connection supports video orientations.

damirstuhec commented 4 years ago

Fixes #8.

twostraws commented 4 years ago

Thank you!