Latest 1.0.2
Homepage https://github.com/Ezfen/EZQRCodeScanner
License MIT
Platforms ios 7.0
Authors



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.

It looks like AliPay.And actually I get the idea from it,thanks for AliPay.
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).

How To Get Started

Installation

You can install EZQRCodeScanner in a traditional way — drag the EZQRCodeScanner/EZQRCodeScanner into your project.(recommended)
EZQRCodeScanner/EZQRCodeScanner文件夹加入到项目中直接使用。

Install with CocoaPods

CocoaPods is a dependency manager for Objective-C and Swift, which automates and simplifies the process of using 3rd-party libraries like EZQRCodeScanner in your projects.
However, it is strongly recommended that you do not install via CocoaPods in this situation, because this pod includes a view controller and we all know usually we have to do some individual work in the controller, so the better way to install this pod is to use the way up there.
But I still show you how to install with Cocoapods.

  • Podfile

    pod 'EZQRCodeScanner', '~> 1.0.0'

Usage

Create a EZQRCodeScanner

  1. Import the "EZQRCodeScanner.h" to your controller.

    #import "EZQRCodeScanner.h"
  2. 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;
  3. Set the animation mode of the scan region. You can choose the mode "Line"(consume CPU strongly) or "NetGrid".

    scanner.scanStyle = EZScanStyleNetGrid;
  4. 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;
  5. Show the EZQRCodeScanner;

    [self.navigationController pushViewController:scanner animated:YES];
  6. You can see the demo for detail.Enjoy. :)

EZQRCodeScannerDelegate

  • -(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
    }

update

    1.0.0     初始化版本,包含两种扫描动画。
    1.0.1     添加是否显示图库和闪光灯开关。
    1.0.2     解决网格图不会被释放的问题。

Issues, Bugs, Suggestions

Open an issue

License

EZQRCodeScanner is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "EZQRCodeScanner",
    "version": "1.0.2",
    "summary": "u4e8cu7ef4u7801u626bu63cf",
    "description": "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.",
    "homepage": "https://github.com/Ezfen/EZQRCodeScanner",
    "license": "MIT",
    "authors": {
        "ChrisCheung": "[email protected]"
    },
    "platforms": {
        "ios": "7.0"
    },
    "source": {
        "git": "https://github.com/Ezfen/EZQRCodeScanner.git",
        "tag": "1.0.2"
    },
    "source_files": [
        "EZQRCodeScanner/EZQRCodeScanner/Controller",
        "EZQRCodeScanner/EZQRCodeScanner/View"
    ],
    "resources": "EZQRCodeScanner/EZQRCodeScanner/Resource/*.png"
}

Pin It on Pinterest

Share This