Latest 1.0.1
Homepage https://github.com/harlanhaskins/HHBarCodeViewController
License MIT
Platforms ios , requires ARC
Authors

HHBarCodeViewController is a quick modal Bar Code reader using the iOS 7 native bar code scanning APIs.

This was originally for me to use because the only implementations I could find were code snippets on blog posts, so I consolidated that code and made it into a handy modal view controller that can be easily presented and has fancy delegate callbacks and blocks.

Woohoo.

Installation

Installation is easiest through CocoaPods. Just add this line to your Podfile
pod 'HHBarCodeViewController'

Usage

Usage is pretty simple. Just instantiate an HHBarCodeViewController using [HHBarCodeViewController new] and present it or push it. Upon recognizing a bar code, the delegate method barCodeViewController:didDetectBarCode: or the block detectedBarCodeBlock() will be called.

I’d highly recommend if you use the returned bar code that you do it in a completion after dismissing the ViewController. This will prevent repeated actions since HHBarCodeViewController calls that delegate method multiple times in its lifetime.

Like this:

- (void) barCodeViewController:(UIViewController *)barCodeViewController didDetectBarCode:(NSString *)barCode {
    [self dismissViewControllerAnimated:YES completion:^{
        dataTextView.text = barCode;
    }];
}

Author

Harlan Haskins (@harlanhaskins)

License

HHBarCodeViewController is available under the MIT license, a copy of which is in the file called LICENSE.

Latest podspec

{
    "name": "HHBarCodeViewController",
    "version": "1.0.1",
    "summary": "HHBarCodeViewController is a quick modal Bar Code reader using the iOS 7 native bar code scanning APIs.",
    "homepage": "https://github.com/harlanhaskins/HHBarCodeViewController",
    "license": "MIT",
    "authors": {
        "Harlan Haskins": "[email protected]"
    },
    "source": {
        "git": "https://github.com/harlanhaskins/HHBarCodeViewController.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/harlanhaskins",
    "requires_arc": true,
    "platforms": {
        "ios": null
    },
    "source_files": "HHBarCodeViewController/*.{h,m}"
}

Pin It on Pinterest

Share This