Skip to content

Conversation

@marra85
Copy link

@marra85 marra85 commented Jan 27, 2026

Support additional barcode formats from iOS 15.4+

Summary

This PR adds support for additional barcode formats available in iOS 15.4+:

  • codabar
  • gs1-data-bar
  • gs1-data-bar-limited
  • gs1-data-bar-expanded

Motivation

Previously, these formats were enabled via a patch-package workaround in my apps. since the new feature for allowedBarcodeTypes was introduced, this change integrates them directly into the codebase using proper availability annotations.

Note

This feature is currently iOS-only (specifically iOS 15.4+). Android support remains unchanged pending the availability of these formats in the native Android camera APIs. (I'm a iOS only developer so I lack the expertise for Android)

Changes

  • Updated CodeFormat.swift enum with new barcode types and proper @available annotations
  • Unified switch statements in conversion methods using inline availability checks
  • Added new formats to codeFormatIOS in types.ts with iOS 15.4+ documentation
  • Updated allCases property to conditionally include iOS 15.4+ formats

How did you test this change?

Tested on iOS 15.4+ simulator/device:

  • All new barcode formats are recognized and properly converted
  • allCases correctly includes iOS 15.4+ formats on supported versions
  • Backwards compatibility maintained for iOS < 15.4 (availability checks prevent crashes)
  • Type definitions align with Swift enum implementation

Screenshots/Testing Results:

Improved allowedBarcodeTypes feature to include other formats available from iOS 15.4+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant