BarcodeToolsKit
Tools to validate and to generate SwiftUI views for various barcode formats (EAN-8, EAN-13, UPC-E, UPC-A)
Install / Use
/learn @villeheikkila/BarcodeToolsKitREADME
BarcodeToolsKit
BarcodeToolsKit provides additional tools for working with barcodes with SwiftUI. It provides a way to validate barcodes and render those using SwiftUI canvas. It also provides a scanner that is limited to scanning the supported barcode types.
Currently supported types include EAN-8, EAN-13, UPC-A and UPC-E.
Installation
Install using SPM
dependencies: [
.package(url: "https://github.com/villeheikkila/BarcodeToolsKit", from: "1.0.0"),
],
targets: [
.target(name: "MyTarget", dependencies: [
.product(name: "BarcodeToolsKit", package: "BarcodeToolsKit"),
]),
]
Import where needed
import BarcodeToolsKit
Requirements
- Swift 6.0+
- iOS/iPadOS/tvOS 17+, watchOS 9, macOS 12+, visionOS 1+
Usage
View
Generate a barcode for a given code, you can also give an optional view that will be used for unsupported unsupported or malformatted codes
BarcodeView(barcode: "6410405176059") {
ContentUnavailableView(
"Unsupported Barcode Type",
systemImage: "barcode"
)
.symbolVariant(.slash)
}
.barcodeStyle(.plain)
.barcodeLineColor(.black)
You can optionally specify the barcode style and color
Default Style

Plain Style

Scan a barcode
BarcodeScannerView {
barcode in print(barcode)
}
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
