TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2015 |
Maintained by Tony Mann.
Scan barcodes with elegance and ease
iOS 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!
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.
TFBarcodeScannerViewController
.
Make sure that your subviews have a transparent region so the preview is visible.viewDidLoad
method, optionally set the barcodeTypes
bit flag to whatever
barcode types you want to scan.barcodeWasScanned
method. This returns a set of barcodes that were
recognized. You normally will call stop
once a suitable barcode is recognized.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.
Requires iOS 7 or greater.