swift_qrcodejs
Cross-platform QRCode generator written in pure Swift, aiming to solve the awkward situation that there's no CIFilter for QRCode generation on Apple Watches.
Installation
Swift Package Manager
dependencies: [
.package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "1.1.1"),
]
CocoaPods
pod 'swift_qrcodejs'
Carthage
github "ApolloZhu/swift_qrcodejs" ~> 1.1.1
Manually
Copy all the .swift
files from the Sources
folder into your project.
Usage
import swift_qrcodejs
guard let qrCode = QRCode("Hello World!") else {
fatalError("Failed to generate QRCode")
}
print(qrCode.toString(filledWith: "##", patchedWith: " "))
For more, checkout the documentation.
Example Projects
- swift_qrcodejs-cli: lightweight command line tool to generate QRCodes.
- EFQRCode: popular Swift framework that generates stylized QRCode images.
- Apple Watch Bilibili: login onto bilibili with QRCode.
License
MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.