Code Monkey home page Code Monkey logo

tfbarcodescanner's Introduction

TFBarcodeScanner

Scan barcodes in iOS7 with elegance and ease

screenshot

iOS7 provides barcode scanning as part of the AV Framework, but it takes some work to figure it all out and then set it up to be efficient and robust. TFBarcodeScanner makes it super easy: create a view controller subclass of TFBarcodeScannerViewController, override barcodeWasScanned, and you are scanning barcodes!

Installation

We recommend using CocoaPods to install TFBarcodeScanner. Add to your Podfile:

pod 'TFBarcodeScanner'

To install manually, add TFBarcodeScanner to your project as a subproject, and then add the TFBarcodeScanner static library in your project's Build Phases.

Usage

  1. Create a view controller that is subclassed from TFBarcodeScannerViewController. Make sure that your subviews have a transparent region so the preview is visible.
  2. In your viewDidLoad method, optionally set the barcodeTypes bit flag to whatever barcode types you want to scan.
  3. Override the barcodeWasScanned method. This returns a set of barcodes that were recognized. You normally will call stop once a suitable barcode is recognized.
  4. If you have UI elements that you want to overlay on top of the scanning preview, override barcodePreviewWillShowWithDuration and show the elements in this method. You will also want to override barcodePreviewWillHideWithDuration to hide these same elements.

See the Demo for sample code.

tfbarcodescanner's People

Contributors

phatmann avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.