Latest 0.3.2
Homepage https://github.com/Grennan/Barcode128View
License MIT
Platforms ios 8.0
Authors

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod "Barcode128View"

Usage

Storyboard setup

First add an UIView to your UIViewController and set its class as Barcode128View as it shown in the picture below.

alt tag

Then, you just have to set all the properties in the attributs inspector and the View will update its content automatically

alt tag

Code setup

If you want to set your Barcode128View properties manually, you can link the view in your code

@IBOutlet weak var codeView: Barcode128View!

then, set the properties

codeView.code128String = "0123456789"
/* optionnal */
codeView.font = UIFont.systemFont(ofSize: 20)
codeView.barColor = UIColor.black
codeView.textColor = UIColor.darkGray
codeView.showCode = true
codeView.padding = 0

Manual setup

You can create a Barcode128View manually with the init(frame:) method and set all the properties

let codeView = Barcode128View(frame: frame)

or with the custom init method bay adding the wanted properties in the init(frame:) method parameters

let secondCodeView = Barcode128View(frame: CGRect(x: 0, y: 0, width: 250, height: 150),
                        code128String: "012345678999",
                        /* optionnal */
                        barColor: .black,
                        textColor: .darkGray,
                        padding: 0,
                        showCode: true,
                        fontName: "Helvetica",
                        fontSize: 30
                        //or font: UIFont.systemFontOfSize(30)
)
view.addSubview(secondCodeView)

Attributes

open var code128String: String! // default ""
open var barColor: UIColor! // default .black
open var textColor: UIColor! // default .black
open var padding: CGFloat! // default 0
open var showCode: Bool! // default false
open var fontName: String! // default "System"
open var fontSize: CGFloat! // default 16
open var font: UIFont! // default UIFont.systemFont(ofSize: 16)

Author

Zimmer

License

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

Latest podspec

{
    "name": "Barcode128View",
    "version": "0.3.2",
    "summary": "A short description of Barcode128View.",
    "description": "TODO: Add long description of the pod here.",
    "homepage": "https://github.com/Grennan/Barcode128View",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "zimmer": ""
    },
    "source": {
        "git": "https://github.com/KillianZimmer/Barcode128View.git",
        "tag": "0.3.2"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Barcode128View/Classes/**/*"
}

Pin It on Pinterest

Share This