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

Added Image Picking Functionality #5

Closed DominatorVbN closed 4 years ago

DominatorVbN commented 4 years ago

No breaking changes in API Removed sampleData (didn't required it anymore)

twostraws commented 4 years ago

Hello! Thank you for this. What happens if someone doesn't have a QR code in their simulator photo library?

DominatorVbN commented 4 years ago

I think sample data should be there and we can provide a button to mock the scan or pick from the gallery.

twostraws commented 4 years ago

Well, if you could please provide a solution that preserves backward compatibility that would be great. This library is used in my videos (see https://www.hackingwithswift.com/books/ios-swiftui/scanning-qr-codes-with-swiftui), so I want to make sure folks can continue using it without having to have a QR code in their library.

DominatorVbN commented 4 years ago

I had updated the codebase with backward compatibility with sampleData users can optionally provide sample data. If they provide the samapleData they will be shown with an extra button "Mock scan with sample data", otherwise only with pick image from the gallery button.

DominatorVbN commented 4 years ago

Well, if you could please provide a solution that preserves backward compatibility that would be great. This library is used in my videos (see https://www.hackingwithswift.com/books/ios-swiftui/scanning-qr-codes-with-swiftui), so I want to make sure folks can continue using it without having to have a QR code in their library.

I am also learning from your content thanks for putting the vast contents for us.

twostraws commented 4 years ago

Thank you!