Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Zxing Android Embedded | 5,260 | 7 months ago | 6 | October 25, 2021 | 100 | apache-2.0 | Java | |||
Barcode scanner library for Android, based on the ZXing decoder | ||||||||||
Barcodescanner | 5,233 | 5 | 3 years ago | 27 | August 19, 2017 | other | Java | |||
Barcode Scanner Libraries for Android | ||||||||||
Html5 Qrcode | 3,297 | 4 | a day ago | 46 | April 07, 2022 | 230 | apache-2.0 | TypeScript | ||
A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org | ||||||||||
Lbxscan | 3,014 | 110 | 3 years ago | 5 | October 22, 2018 | 148 | mit | Objective-C | ||
A barcode and qr code scanner (二维码、扫码、扫一扫、ZXing、ZBar、iOS系统AVFoundation扫码封装,扫码界面效果封装) | ||||||||||
Zxinglite | 2,592 | 2 months ago | 4 | June 22, 2022 | 24 | apache-2.0 | Java | |||
🔥 ZXing的精简极速版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信) | ||||||||||
React Native Qrcode Scanner | 1,986 | 171 | 9 | a month ago | 51 | February 11, 2022 | 123 | mit | JavaScript | |
A QR code scanner component for React Native. | ||||||||||
React Native Camera Kit | 1,983 | 46 | 11 | 3 days ago | 185 | September 15, 2022 | 82 | mit | Objective-C | |
A high performance, easy to use, rock solid camera library for React Native apps. | ||||||||||
Qrcodereaderview | 1,770 | 231 | 3 years ago | 2 | March 29, 2017 | 49 | Java | |||
Modification of ZXING Barcode Scanner project for easy Android QR-Code detection and AR purposes | ||||||||||
Barcodescanner | 1,631 | 33 | 9 hours ago | 16 | March 11, 2018 | 25 | other | Swift | ||
:mag_right: A simple and beautiful barcode scanner. | ||||||||||
Sgqrcode | 1,594 | 28 | a year ago | 21 | July 16, 2022 | 5 | apache-2.0 | Objective-C | ||
The easy to use bar code and QR code scan library for iOS【支持二维码生成、图片中读取二维码、条形码和二维码扫描】 |
BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience.
To start capturing just instantiate BarcodeScannerViewController
, set needed
delegates and present it:
let viewController = BarcodeScannerViewController()
viewController.codeDelegate = self
viewController.errorDelegate = self
viewController.dismissalDelegate = self
present(viewController, animated: true, completion: nil)
You can also push BarcodeScannerViewController
to your navigation stack:
let viewController = BarcodeScannerViewController()
viewController.codeDelegate = self
navigationController?.pushViewController(viewController, animated: true)
Code delegate
Use BarcodeScannerCodeDelegate
when you want to get the captured code back.
extension ViewController: BarcodeScannerCodeDelegate {
func scanner(_ controller: BarcodeScannerViewController, didCaptureCode code: String, type: String) {
print(code)
controller.reset()
}
}
Error delegate
Use BarcodeScannerErrorDelegate
when you want to handle session errors.
extension ViewController: BarcodeScannerErrorDelegate {
func scanner(_ controller: BarcodeScannerViewController, didReceiveError error: Error) {
print(error)
}
}
Dismissal delegate
Use BarcodeScannerDismissalDelegate
to handle "Close button" tap.
Please note that BarcodeScannerViewController
doesn't dismiss itself if
it was presented initially.
extension ViewController: BarcodeScannerDismissalDelegate {
func scannerDidDismiss(_ controller: BarcodeScannerViewController) {
controller.dismiss(animated: true, completion: nil)
}
}
When the code is captured BarcodeScannerViewController
switches to the processing
mode:
While the user sees a nice loading animation you can perform some background task, for example make a network request to fetch product info based on the code. When the task is done you have 3 options to proceed:
BarcodeScannerViewController
and show your results.func scanner(_ controller: BarcodeScannerViewController, didCaptureCode code: String, type: String) {
// Code processing
controller.dismiss(animated: true, completion: nil)
}
func scanner(_ controller: BarcodeScannerViewController, didCaptureCode code: String, type: String) {
// Code processing
controller.resetWithError(message: "Error message")
// If message is not provided the default message will be used instead.
}
func scanner(_ controller: BarcodeScannerViewController, didCaptureCode code: String, type: String) {
// Code processing
controller.reset(animated: true)
}
If you want to do continuous barcode scanning just set the isOneTimeSearch
property on your BarcodeScannerViewController
instance to false
.
We styled BarcodeScanner to make it look nice, but you can always use public properties or inheritance to customize its appearance.
Header
let viewController = BarcodeScannerViewController()
viewController.headerViewController.titleLabel.text = "Scan barcode"
viewController.headerViewController.closeButton.tintColor = .red
Please note that HeaderViewController
is visible only when
BarcodeScannerViewController
is being presented.
Footer and messages
let viewController = BarcodeScannerViewController()
viewController.messageViewController.regularTintColor = .black
viewController.messageViewController.errorTintColor = .red
viewController.messageViewController.textLabel.textColor = .black
Camera
let viewController = BarcodeScannerViewController()
// Change focus view style
viewController.cameraViewController.barCodeFocusViewType = .animated
// Show camera position button
viewController.cameraViewController.showsCameraButton = true
// Set the initial camera position
viewController.cameraViewController.initialCameraPosition = .front // Default is .back
// Set settings button text
let title = NSAttributedString(
string: "Settings",
attributes: [.font: UIFont.boldSystemFont(ofSize: 17), .foregroundColor : UIColor.white]
)
viewController.cameraViewController.settingButton.setAttributedTitle(title, for: UIControlState())
Metadata
// Add extra metadata object type
let viewController = BarcodeScannerViewController()
viewController.metadata.append(AVMetadataObject.ObjectType.qr)
BarcodeScanner is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BarcodeScanner'
Don't forget to set a Privacy - Camera Usage Description
in your Info.plist file, else the app will crash with a SIGBART.
In order to quickly try the demo project of a BarcodeScanner just run
pod try BarcodeScanner
in your terminal.
BarcodeScanner is also available through Carthage. To install just write into your Cartfile:
github "hyperoslo/BarcodeScanner"
To install BarcodeScanner manually just download and drop Sources
and
Images
folders in your project.
Hyper Interaktiv AS, [email protected]
We would love you to contribute to BarcodeScanner, check the CONTRIBUTING file for more info.
BarcodeScanner is available under the MIT license. See the LICENSE file for more info.