twostraws / CodeScanner

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

Add a view modifier to allow to present gallery and import a code #51

Closed nathanfallet closed 2 years ago

nathanfallet commented 2 years ago

As it can be done in the simulator, add the ability to import an image from gallery and load a qr code from it.

This can be done this way:

CodeScannerView(
    // ...
)
.importFromGallery(isPresented: $importFromGallery)

Where $importFromGallery is a Binding<Bool>

Note: if I have some free time next week, I will try to make a Pull Request for that