Latest 0.1.0
Homepage https://github.com/ampirator/EANBarcodeGenerator
License MIT
Platforms ios 9.0
Frameworks UIKit, CoreImage, Foundation
Authors

CI Status
Version
License
Platform

EANBarcodeGenerator provides CIFilter CIEANBarcodeGenerator for generating EAN-13, UPC-A barcodes. This generator was created for iOS application PokeWall (https://itunes.apple.com/us/app/pokewall/id1449455385)

Example

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

Example

Requirements

iOS 9.0+

Installation

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

pod 'EANBarcodeGenerator'

Usage

Import Framework:

import EANBarcodeGenerator

Register CIFilter:

CIEANBarcodeGenerator.register()

you can place this code for example into method of ApplicationDelegate application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?)

Generate barcode:

let filter = CIFilter(name: "CIEANBarcodeGenerator")
filter?.setValue("5901234123457", forKey: "inputMessage")
let image = filter?.outputImage

outputImage represents CIImage with width: 95 pixels, height: 32 pixels. To get UIImage with certain size, you can use next code:

let scaleX = uiImageSize.width / ciImage.extent.width
let scaleY = uiImageSize.height / ciImage.extent.height
let uiImage = UIImage(ciImage: ciImage.transformed(by: CGAffineTransform(scaleX: scaleX, y: scaleY)))

Author

Sergey Bayborodov, [email protected]

License

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

Latest podspec

{
    "name": "EANBarcodeGenerator",
    "version": "0.1.0",
    "summary": "EAN-13, UPC-A barcode generator.",
    "description": "EANBarcodeGenerator provides CIFilter witch allows to generate EAN-13, UPC-A barcodes.nThis generator was created for iOS application PokeWall (https://itunes.apple.com/us/app/pokewall/id1449455385)",
    "homepage": "https://github.com/ampirator/EANBarcodeGenerator",
    "screenshots": "https://raw.githubusercontent.com/ampirator/EANBarcodeGenerator/master/Images/screenshot.jpg",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Sergey Bayborodov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ampirator/EANBarcodeGenerator.git",
        "tag": "0.1.0"
    },
    "swift_version": "4.2",
    "platforms": {
        "ios": "9.0"
    },
    "source_files": "EANBarcodeGenerator/Classes/**/*",
    "frameworks": [
        "UIKit",
        "CoreImage",
        "Foundation"
    ]
}

Pin It on Pinterest

Share This