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

allow user to cancel #45

Closed mvolkmann closed 2 years ago

mvolkmann commented 2 years ago

Is there a way I can add a button over the CodeScanner to allow the user to cancel their request to scan? I see that they can just slide the sheet down to dismiss it, but I'm concerned that won't be discoverable by a user.

twostraws commented 2 years ago

If you want to add a cancel button, wrap the code scanner in a NavigationView, then add any toolbar contents you want. This is much more customizable than us trying to cater for a variety of toolbar configurations.