@@ -122,36 +122,34 @@ on the code. When the task is done you have 3 options to proceed:
122122
1231231 . Dismiss ` BarcodeScannerController ` and show your results.
124124
125- ``` swift
126- func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
127- // Code processing
128- controller.dismissViewControllerAnimated (true , completion : nil )
129- }
130- ```
131-
125+ ``` swift
126+ func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
127+ // Code processing
128+ controller.dismissViewControllerAnimated (true , completion : nil )
129+ }
130+ ```
1321312 . Show an error message and switch back to the scanning mode (for example,
133132when there is no product found with a given barcode in your database):
134133
135- <div align =" center " >
136- <img src =" https://github.com/hyperoslo/BarcodeScanner/blob/master/Art/ExampleError.png " alt =" BarcodeScanner error " width =" 270 " height =" 480 " />
137- </div ><br />
138-
139- ``` swift
140- func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
141- // Code processing
142- controller.resetWithError (" Error message" )
143- // If message is not provided the default message from the config will be used instead.
144- }
145- ```
146-
134+ <div align =" center " >
135+ <img src =" https://github.com/hyperoslo/BarcodeScanner/blob/master/Art/ExampleError.png " alt =" BarcodeScanner error " width =" 270 " height =" 480 " />
136+ </div ><br />
137+
138+ ``` swift
139+ func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
140+ // Code processing
141+ controller.resetWithError (" Error message" )
142+ // If message is not provided the default message from the config will be used instead.
143+ }
144+ ```
1471453 . Reset the controller to the scanning mode (with or without animation):
148146
149- ``` swift
150- func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
151- // Code processing
152- controller.reset (animated : true )
153- }
154- ```
147+ ``` swift
148+ func barcodeScanner (controller : BarcodeScannerController, didCapturedCode code : String ) {
149+ // Code processing
150+ controller.reset (animated : true )
151+ }
152+ ```
155153
156154If you want to do continuous barcode scanning just set the ` oneTimeSearch `
157155property on your ` BarcodeScannerController ` instance to ` false ` .
0 commit comments