CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2016 |
Maintained by Ezfen Zhang.
EZQRCodeScanner in Objective-C.
A simple QRCode scanner, including a view controller which is in charge of the working of AVFoundation and other UI things, a view which draws the line, sets the background color and makes a transparent region at the center. It's very simple so I have nothing to show off, hhhh.
Why I make this QRCode Scanner is that I want to simplify the same work I usually do. The next time I need the QRCode Scanner, I can use it immediately.
Actually, I want to create three mode of the animation to show in the scanner view. But I have some problems in the last mode. So the version 1.0.0 only has the mode "line" and mode "netgrid". I will create the third mode as soon as possible.
The flash button can turn the flash light on or off, and the album button can open the album of your device for you to choose a QRCode picture to be analysed(Only support iPhone5S and later thanks to the arm64).
You can install EZQRCodeScanner in a traditional way -- drag the EZQRCodeScanner/EZQRCodeScanner into your project.(recommended)
将 EZQRCodeScanner/EZQRCodeScanner文件夹加入到项目中直接使用。
Import the "EZQRCodeScanner.h" to your controller.
#import "EZQRCodeScanner.h"
Init the EZQRCodeScanner into your controller.
EZQRCodeScanner *scanner = [[EZQRCodeScanner alloc] init];
If you want to do something after invoking the EZQRCodeScanner, set up the delegate.
一般来说,需要在扫描器得到结果后会通过delegate回调,因此需设置代理并实现相关方法。
scanner.delegate = self;
Set the animation mode of the scan region. You can choose the mode "Line"(consume CPU strongly) or "NetGrid".
scanner.scanStyle = EZScanStyleNetGrid;
Set the showButton of the scanner.If you wanna show the flashlight and the album button under the scanner region, put it YES.
scanner.showButton = YES;
Show the EZQRCodeScanner;
[self.navigationController pushViewController:scanner animated:YES];
You can see the demo for detail.Enjoy. :)
-(void)scannerView:(EZQRCodeScanner *)scanner outputString:(NSString *)output; @required
When the scanner get the message from the QRCode correctly, it will invoke this delegate function. The output is the message inside the QRCode.
- (void)scannerView:(EZQRCodeScanner *)scanner outputString:(NSString *)output {
// do something to the output and pop the scanner from the navigationController if you use push before.
}
-(void)scannerView:(EZQRCodeScanner *)scanner errorMessage:(NSString *)errorMessage; @optional
- (void)scannerView:(EZQRCodeScanner *)scanner errorMessage:(NSString *)errorMessage {
// optional, do something to deal with the error
}
1.0.0 初始化版本,包含两种扫描动画。
1.0.1 添加是否显示图库和闪光灯开关
Open an issue
EZQRCodeScanner is available under the MIT license. See the LICENSE file for more info.