A QR code generator written in pure Swift with no dependencies.
The project is mostly a direct translation of Nayuki's QR code generator for Rust, with small changes applied to make the code more idiomatic in Swift.
To use in your project, add the following dependency to your Package.swift
:
.package(url: "https://github.com/fwcd/swift-qrcode-generator.git", from: "0.0.1")
import QRCodeGenerator
let qr = try! QRCode.encode(text: text, ecl: .medium)
let svg = qr.toSVGString(border: 4)