Swiftpack.co - sparrowcode/SPQRCode as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by sparrowcode.
sparrowcode/SPQRCode 1.0.4
The native QR code scanner of iOS. Repeated system scanner from the camera app.
⭐️ 77
🕓 2 years ago
iOS
.package(url: "https://github.com/sparrowcode/SPQRCode.git", from: "1.0.4")

SPQRCode

iOS Dev Community

Installation

Ready for use on iOS 13+.

Swift Package Manager

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/sparrowcode/SPQRCode", .upToNextMajor(from: "1.0.4"))
]

Manually

If you prefer not to use any of dependency managers, you can integrate manually. Put Sources/SPQRCode folder in your Xcode project. Make sure to enable Copy items if needed and Create groups.

Usage

Example for handle QRCode.

SPQRCode.scanning(
    detect: { data, controller in
        return data
    }, 
    handled: { data, controller in
        controller.dismiss(animated: true)
    },
    on: viewController
)

If you want allow handle only specific type, like url or Ethereum wallet, in detect handler retun nil if you don't want handle current QR code data.

GitHub

link
Stars: 77
Last commit: 20 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Clean code and update example app.
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics