GTMBarcodeScanner
Swift 实现的条码扫描组件库
说明
- 支持设置不同风格的扫码动效(仿微信,仿支付宝)
- 自动检测光线强度,开启闪光灯
- 条码太小时候自动拉近镜头效果
- 自定义扫码音效
例子
直接下载代码,里面Example里面有详细的使用实例代码
!
安装
Cocoapods方式
Install Cocoapods if need be.
$ gem install cocoapods
Add GTMBarcodeScanner
in your Podfile
.
use_frameworks!
pod 'GTMBarcodeScanner'
Then, run the following command.
$ pod install
常规方式
Copy GTMBarcodeScanner
folder to your project. That’s it.
Note: Make sure that all files in GTMBarcodeScanner
included in Compile Sources in Build Phases.
版本
Vesrion 1.0
This version requires Xcode 9.0 and Swift 4.
使用帮助
首先, import GTMBarcodeScanner
.
import GTMBarcodeScanner
创建Scanner
let scanner = BarcodeScanner.create(view: self.view)
// 风格设置
scanner.makeStyle {
(make) in
let color = UIColor.init(red: 255/255, green: 157/255