@@ -39,7 +39,7 @@ The preferred way of installing SwiftUIX is via the [Swift Package Manager](http
3939
40401 . In Xcode, open your project and navigate to ** File** → ** Swift Packages** → ** Add Package Dependency...**
41412 . Paste the repository URL (` https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI ` ) and click ** Next** .
42- 3 . For ** Rules** , select ** Branch** (with branch set to ` 2.1.0 ` ).
42+ 3 . For ** Rules** , select ** Branch** (with branch set to ` 2.1.1 ` ).
43434 . Click ** Finish** .
4444
4545# Example project
@@ -73,8 +73,7 @@ struct ContentView: View {
7373 scanInterval : .constant (5.0 ) // Event will trigger every 5 seconds
7474 ){
7575 // When the scanner found a barcode
76- print ($0 .value )
77- print (" Barcode Type is" , $0 .type .rawValue )
76+ print (" BarCodeType =" ,$0 .type .rawValue , " Value =" ,$0 .value )
7877 }
7978
8079 }
@@ -95,8 +94,7 @@ struct ContentView: View {
9594 scanInterval : .constant (5.0 ) // Event will trigger every 5 seconds
9695 ){
9796 // When the scanner found a barcode
98- print ($0 .value )
99- print (" Barcode Type is" , $0 .type .rawValue )
97+ print (" BarCodeType =" ,$0 .type .rawValue , " Value =" ,$0 .value )
10098 }
10199 onDraw : {
102100 print (" Preview View Size = \( $0 .cameraPreviewView .bounds ) " )
@@ -145,8 +143,7 @@ struct ContentView: View {
145143 torchLightIsOn : $torchIsOn // Bind a Bool to enable/disable torch light
146144 ){
147145 // When the scanner found a barcode
148- print ($0 .value )
149- print (" Barcode Type is" , $0 .type .rawValue )
146+ print (" BarCodeType =" ,$0 .type .rawValue , " Value =" ,$0 .value )
150147 }
151148 }
152149 }
@@ -191,8 +188,7 @@ struct ContentView: View {
191188 cameraPosition : $cameraPosition // Bind to switch front/back camera
192189 ){
193190 // When the scanner found a barcode
194- print ($0 .value )
195- print (" Barcode Type is" , $0 .type .rawValue )
191+ print (" BarCodeType =" ,$0 .type .rawValue , " Value =" ,$0 .value )
196192 }
197193 }
198194 }
@@ -213,8 +209,7 @@ No need to remove the mock barcode from the production app it will only use for
213209 mockBarCode : .constant (BarcodeData (value :" Mocking data" , type : .qr ))
214210 ){
215211 // When you click the button on screen mock data will appear here
216- print ($0 .value )
217- print (" Barcode Type is" , $0 .type .rawValue )
212+ print (" BarCodeType =" ,$0 .type .rawValue , " Value =" ,$0 .value )
218213 }
219214```
220215
@@ -285,6 +280,7 @@ CBBarcodeView(data: ..... ,
285280CarBode welcomes contributions in the form of GitHub issues and pull- requests.
286281
287282## Changelog
283+ - 2.1.1 Fixed bugs
288284 - 2.1.0 You can draw a box around the barcode
289285 - 2.0.1 Fixed bugs
290286 - 2.0.0 I learned many more things about SwiftUI then I decide to restructure the scanner I hope you will like it. And this version you can switch front and back camera.
0 commit comments