SkillAgentSearch skills...

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/BarcodeToolsKit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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

Default Style

Plain Style

Default Style

Scan a barcode

BarcodeScannerView {
    barcode in print(barcode)
}

Related Skills

View on GitHub
GitHub Stars4
CategoryDevelopment
Updated4mo ago
Forks1

Languages

Swift

Security Score

82/100

Audited on Dec 1, 2025

No findings