BarcodeHero is a library that allows you to generate and scan barcodes.
:warning: The code in this library has been provided as-is. SpotHero uses this library in Production, but it may lack the documentation, stability, and functionality necessary to support external use. While we work on improving this codebase, use this library at your own risk and please reach out if you have any questions or feedback.
throwsand errors are clear and concise.)
Swift Package Manager is built into the Swift toolchain and is our preferred way of integrating the SDK.
For Swift package projects, simply add the following line to your
Package.swift file in the
dependencies: [ .package(url: "https://github.com/spothero/BarcodeHero-iOS", .upToNextMajor(from: "<version>")), ]
For app projects, simply follow the Apple documentation on adding package dependencies to your app.
CocoaPods is a dependency manager for Cocoa projects.
We no longer support CocoaPods for versions later then
You can easily generate a barcode by doing the following:
let image = try BHBarcodeGenerator.generate(.qr, withData: "Example")
There are also extensions for resizing the barcode to a
UIImageView without aliasing or blur:
try image.resizeTo(barcodeImageView) try image.resizeTo(CGSize(width: 100, height: 20), forContentMode: .scaleAspectFit)
For all bug reports, feature requests, and general communication, please open an issue to get in contact with us.
|Last commit: 1 week ago|
BarcodeHeroUI is now supported via SPM. In order to support SPM, we had to drop all resources from the package. This meant programmatically assigning constraint and otherwise to the
When SPM introduces resource support, we can circle back and update this... or perhaps even leverage
SwiftUI instead where available.