Latest 1.1.0
Homepage https://github.com/Coledunsby/CDCodabarView
License MIT
Platforms ios 9.0, requires ARC
Authors

Version
License
Platform
Language

What is it?

CDCodabarView is a Codabar barcode generator for iOS.

It is written in Swift 4 and uses IBDesignable, IBInspectable and Core Graphics.

Installation

CDCodabarView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CDCodabarView'

Alternatively, you can install it manually by copying CDCodabarView.swift and CDCodabarEncoder.swift into your project.

Usage (Storyboards)

  1. Drag a UIView into your storyboard.
  2. Change the class of the UIView to CDCodabarView.
  3. Customize your barcode using the inspector.

alt tag

Usage (Programmatically)

  1. Import the module:

    import CDCodabarView
  2. Initialize an instance of CDCodabarView using the constructor:

    let codabarView = CDCodabarView()
    codabarView.frame = CGRect(x: 0, y: 0, width: 200, height: 100)
    codabarView.code = "A12345B"
    codabarView.backgroundColor = .white
  3. Customize the barcode:

    codabarView.barColor = .blue
    codabarView.textColor = .red
    codabarView.padding = 5
    codabarView.hideCode = false
    codabarView.font = UIFont(name: "AvenirNext-Regular", size: 15.0)!
  4. Add the barcode to your view:

    view.addSubview(codabarView)

See the example project for more usage examples.

Author

Cole Dunsby, [email protected]

License

CDCodabarView is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "CDCodabarView",
    "version": "1.1.0",
    "swift_version": "4.0",
    "summary": "Codabar Barcode Generator for iOS.",
    "homepage": "https://github.com/Coledunsby/CDCodabarView",
    "authors": {
        "Cole Dunsby": "[email protected]"
    },
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "platforms": {
        "ios": "9.0"
    },
    "requires_arc": true,
    "source": {
        "git": "https://github.com/Coledunsby/CDCodabarView.git",
        "tag": "v/1.1.0"
    },
    "source_files": "*.swift",
    "module_name": "CDCodabarView"
}

Pin It on Pinterest

Share This