Skip to content

danielsaidi/ScanCodes

Repository files navigation

Project Icon

Version Swift 6.0 Documentation MIT License Sponsor my work

ScanCodes

ScanCodes is a Swift library with scan code features, such as a ScanCode SwiftUI view that can render any string value as a scan code.

Demo Gif

ScanCodes extends Image as well as platform-specific image types with scan code-related functionality, and has a ScanCodeType enum that defines all supported scan code types.

Installation

ScanCodes can be installed with the Swift Package Manager:

https://github.com/danielsaidi/ScanCodes.git

Supported Platforms

ScanCodes supports iOS 15, iPadOS 15, macOS 12, tvOS 15, and visionOS 1.

Support My Work

You can become a sponsor to help me dedicate more time on my various open-source tools. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.

Getting Started

To render a scan code in SwiftUI, just add a ScanCode with the value and type to render:

struct ContentView: View {

    var body: some View {
        ScanCode(
            value: "123456789", 
            type: .qr, 
            scale: 5,
            rotation: .pi/4
        )
    }
}

You can use the same init arguments to create a SwiftUI SwiftUICore/Image and platform-specific image values.

Documentation

The online documentation has more information, articles, code examples, etc.

Demo Application

The Demo folder has a demo app that lets you explore the library.

Contact

Feel free to reach out if you have questions, or want to contribute in any way:

License

ScanCodes is available under the MIT license. See the LICENSE file for more info.

About

Add QR and bar codes to SwiftUI apps.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project