Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 QRCodeGenerator

let qr = try! QRCode.encode(text: text, ecl: .medium)
let svg = qr.toSVGString(border: 4)
```