BarcodeEasyScan📢
简单一行代码实现条形码扫描。无需样板代码、无 xib、无 storboards。
示例📚
要运行示例项目,请首先克隆仓库,并在 Example 目录下运行 pod install。
安装⏳
BarcodeEasyScan 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'BarcodeEasyScan'使用💡
在您的 viewcontroller 类中导入 pod。
import BarcodeEasyScan
您需要将 "Privacy - Camera usage description" 键添加到您应用的 Info.plist 中
显示 'BarcodeScannerViewController' 并将其代理分配给自己。
// Call this controller to open barcode screen
let barcodeViewController = BarcodeScannerViewController()
barcodeViewController.delegate = self
self.present(barcodeViewController, animated: true, completion: {
})
使用 'ScanBarcodeDelegate' 来实现 userDidScanWith(barcode: String) 方法。
func userDidScanWith(barcode: String) {
// This method results the scanned barcode string
}
作者😇
我的邮箱地址,[email protected]
|
Harshal Jadhav |
许可
这都是你自己的
