Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/netshade/Cocoa-Touch-Barcodes
Fork of Jeff Lamarche's original barcode generator library at http://code.google.com/p/cocoabarcodes/
https://github.com/netshade/Cocoa-Touch-Barcodes
Last synced: about 1 month ago
JSON representation
Fork of Jeff Lamarche's original barcode generator library at http://code.google.com/p/cocoabarcodes/
- Host: GitHub
- URL: https://github.com/netshade/Cocoa-Touch-Barcodes
- Owner: netshade
- Archived: true
- Created: 2010-04-21T14:29:07.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2016-08-07T10:25:30.000Z (over 8 years ago)
- Last Synced: 2024-10-31T15:40:28.293Z (about 1 month ago)
- Language: Objective-C
- Homepage:
- Size: 312 KB
- Stars: 285
- Watchers: 12
- Forks: 63
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - Cocoa-Touch-Barcodes - Fork of Jeff Lamarche's original barcode generator library at http://code.google.com/p/cocoabarcodes/ (etc)
- awesome - Cocoa-Touch-Barcodes - Fork of Jeff Lamarche's original barcode generator library at http://code.google.com/p/cocoabarcodes/ (etc)
README
This is a fork of [Jeff Lamarche's Cocoa Barcodes project](http://code.google.com/p/cocoabarcodes/), with the code modified to work on the iPhone and iPad. In my testing, a CCD and laser scanner can read UPC and Code 128 barcodes directly from the screen w/ no issue. I haven't tested other barcodes yet.
Usage:
You can add the project as a dependency to your existing project and add a target dependency on the static library target. Alternatively you can add the source code bulk to your own project.If you use the static library dependency, you'll want to ensure that you are compiling your own project with the `-ObjC` "Other Linker Flag" in your project settings.
To use the library, you'll want to include the relevant header file for the barcode you want to generate, as well as the UIImage category for generating the image.
```objectivec
#import "NKDUPCEBarcode.h"
#import "UIImage-NKDBarcode.h"// etc...
NKDUPCEBarcode * code = [[NKDUPCEBarcode alloc] initWithContent:@"Your Barcode Contents"];
NSData * generatedPdf = [UIImage pdfFromBarcode:code]; // Generate the barcode as a PDF
UIImage * generatedImage = [UIImage imageFromBarcode:code]; // ..or as a less accurate UIImage
```TODO:
* Add tests. (!!!!!!!!!!!)
* Better documentation
* Really, the entire API pretty much needs a refactor. The UIImage category as entry point into generating images as a start, NKDBarcodeOffscreenView doesn't really need to subclass UIView, etc..
* Leak checks
* ARC compatibility? I guess?Things that are missing:
* Rendering the actual numbers of a code below the barcode
* rectForPage, knowsPageRange don't have any affect on the barcode rendering nowThings that have changed:
* the UIImage for the barcode is generated on the calling thread, as opposed to the library's old behavior of generating the image on a separate thread
* the library provides UIImage and PDF generation of barcodes - PDF is more accurateThings that misbehave:
* The Code128 generation works for many common cases, but we need a test suite to verify behavior
Things that have been fixed:
* The Code128 checksum generation has had some issues fixed
* Generation of EAN-13 barcodes that start with 2. See http://code.google.com/p/cocoabarcodes/issues/detail?id=3Current status:
* I'm very inactive with maintenance. I'm not currently maintaining the code, nor do I have a plan to get to any of the major checklist items anytime soon. If you're interested in taking a more active role in development, contact me and I'll do what I can to help you out.
Other contributors:
* [dalewking](https://github.com/dalewking)
* [mdestagnol](https://github.com/mdestagnol)
* [teh1ghool](https://github.com/teh1ghool)
* [jasonkhonm](https://github.com/jasonkhonm)