Simple barcode reader. Please help

Hello everyone, first let me say a few words about myself. I am an IT student and I want to learn and develop some applications in Swift. Now I am working on one application and I need a barcode scanner to complete it. So I need help from someone who can help me with a simple barcode scanner. My idea is that the barcode will be on one screen and they have to read the code and write it to a variable. That's my idea. I will appreciate the full code or help. thank you for answer

Answered by ssmith_c in 775611022

The Vision framework can detect various types of barcodes (start here: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest)

If you need to create bar codes to work with, you can use a built-in CoreImage filter to generate a bar code. See https://developer.apple.com/documentation/coreimage/cibarcodedescriptor.

The links above should give you a starting point, and some keywords to search with.

Accepted Answer

The Vision framework can detect various types of barcodes (start here: https://developer.apple.com/documentation/vision/vndetectbarcodesrequest)

If you need to create bar codes to work with, you can use a built-in CoreImage filter to generate a bar code. See https://developer.apple.com/documentation/coreimage/cibarcodedescriptor.

The links above should give you a starting point, and some keywords to search with.

The DataScannerViewController is available to easily handle this exact scenario.

Here's the docs. https://developer.apple.com/documentation/visionkit/scanning_data_with_the_camera

And here's the WWDC video. https://developer.apple.com/videos/play/wwdc2022/10025/

Simple barcode reader. Please help
 
 
Q