Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fwcd/swift-qrcode-generator
QR code generator written in pure Swift
https://github.com/fwcd/swift-qrcode-generator
linux qrcode qrcode-generator swift
Last synced: 23 days ago
JSON representation
QR code generator written in pure Swift
- Host: GitHub
- URL: https://github.com/fwcd/swift-qrcode-generator
- Owner: fwcd
- License: mit
- Created: 2020-02-25T17:17:17.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-11-20T01:17:08.000Z (12 months ago)
- Last Synced: 2024-04-14T12:39:35.657Z (7 months ago)
- Topics: linux, qrcode, qrcode-generator, swift
- Language: Swift
- Size: 81.1 KB
- Stars: 45
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swift QR Code Generator
[![Linux](https://github.com/fwcd/swift-qrcode-generator/actions/workflows/linux.yml/badge.svg)](https://github.com/fwcd/swift-qrcode-generator/actions/workflows/linux.yml)
[![Darwin](https://github.com/fwcd/swift-qrcode-generator/actions/workflows/darwin.yml/badge.svg)](https://github.com/fwcd/swift-qrcode-generator/actions/workflows/darwin.yml)A QR code generator written in pure Swift with no dependencies.
The project is mostly a direct translation of [Nayuki's](https://github.com/nayuki/) [QR code generator for Rust](https://github.com/nayuki/QR-Code-generator/tree/master/rust), with small changes applied to make the code more idiomatic in Swift.
## Usage
### Swift Package Manager
To use in your project, add the following dependency to your `Package.swift`:```swift
.package(url: "https://github.com/fwcd/swift-qrcode-generator.git", from: "1.0.0")
```### CocoaPods
Swift QR Code Generator is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```bash
pod 'SwiftQRCodeGenerator'
```## Example
```swift
import QRCodeGeneratorlet qr = try! QRCode.encode(text: text, ecl: .medium)
let svg = qr.toSVGString(border: 4)
```