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

Add viewfinder #29

Closed abrown252 closed 3 years ago

abrown252 commented 3 years ago

This PR adds a viewfinder to the camera. To enable this, pass in showViewfinder: true when constructing CodeScannerView.

        CodeScannerView(
            codeTypes: [.qr],
            showViewfinder: true,
            completion: { result in
                ...
            }
        )

To support Resources in this package, the swift-tools-version has been increased to 5.3.

IMG_8070305608A0-1

xremix commented 3 years ago

This viewfinder looks great! Does it make sense to have a SVG instead of PDF file for the image @abrown252?

abrown252 commented 3 years ago

@xremix thanks! That's a great idea, I missed the SVG support added to Xcode 12 so I've been using PDFs 🤦‍♂️

twostraws commented 3 years ago

Fantastic – thank you!