Swiftpack.co - Package - ApolloZhu/swift_qrcodejs


CocoaPods Version CocoaPods Compatible Platforms Swift Package Manager Compatible Carthage Compatible

Swift 5.0 MIT License Build Status Code Coverage Documentation

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.


Swift Package Manager
dependencies: [
    .package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "1.1.2"),
pod 'swift_qrcodejs'
github "ApolloZhu/swift_qrcodejs" ~> 1.1.2

Copy all the .swift files from the Sources folder into your project.


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


MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.


Stars: 15
Help us keep the lights on



1.1.3 - Nov 28, 2019

Update Swift version from 4.2 to 5.0 in config files. Nothing else changed.

1.1.2 - Sep 17, 2019

What's New

List all supported Swift versions in podspec by @chrisballinger (#6). Requires CocoaPods 1.7.5 or a newer version.

1.1.1 - Mar 30, 2019

swift-version and podspec remains to be Swift 4.2 to maximize compatibility

1.1.0 - Feb 20, 2019

What's New

Added option to choose text encoding for QRCode data by @joaodforce (#5)

Author's Perspective

Some other parts of this library still assumes UTF-8, so I'm expecting to see some test cases, crash reports, and/or other failures to come in, based on my limited knowledge of QRCode. Please open issues and/or pull requests when you encounter unexpected results.

1.0.1 - Oct 21, 2018

What's New

Fix hanging when string exceeds the maximum capable length to convert (#4) Fix crashes when UTF-8 length of string is in range [195, 220] (#4)