Skip to content

SwiftUI Code39 is a Swift package that provides an easy way to generate Code 39 barcodes in your SwiftUI applications.

License

Notifications You must be signed in to change notification settings

jiahan-wu/swiftui-code39

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftUI Code39

SwiftUI Code39 is a Swift package that provides an easy way to generate Code 39 barcodes in your SwiftUI applications.

Installation

To use SwiftUI Code39 in your project:

  1. Xcode > File > Add Package Dependencies
  2. Add https://github.com/jiahan-wu/swiftui-code39.git
  3. Select "Up to Next Major Version" with "1.0.0"

Then, import the package in your Swift code:

import Code39

Usage

To generate a Code 39 barcode, simply create a Code39View and provide the desired content as a string:

struct ContentView: View {
    var body: some View {
        Code39View("HELLO WORLD")
            .frame(width: 296, height: 96)
    }
}

Important Note

It is the responsibility of the library user to ensure that the content passed to Code39View consists of valid characters supported by Code 39. You can use the code39SupportedCharacters set to check if a character is supported:

let content = "HELLO"
let isValid = content.allSatisfy { code39SupportedCharacters.contains($0) }

License

SwiftUI Code39 is released under the MIT License. See the LICENSE file for more information.

Contributing

Contributions to SwiftUI Code39 are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

About

SwiftUI Code39 is a Swift package that provides an easy way to generate Code 39 barcodes in your SwiftUI applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages