Git Product home page Git Product logo

cocoa-touch-barcodes's Introduction

This is a fork of Jeff Lamarche's Cocoa Barcodes project, 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.

#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 now

Things 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 accurate

Things that misbehave:

  • The Code128 generation works for many common cases, but we need a test suite to verify behavior

Things that have been fixed:

Current 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:

cocoa-touch-barcodes's People

Contributors

dalewking avatar jasonkhonm avatar

Watchers

James Cloos avatar 腹黒い茶 avatar  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.