Latest 0.9.2
License MIT
Platforms ios 12.0


Preferred installation is using CocoaPods.

To Integrate the ShapeQRCode into your project using CocoaPods, specify it in your Podfile:

pod 'ShapeQRCode'

After that, continue using the following command:

$ pod install


Basically there’re a ton of different customizations ShapeQRCode supports. I will explain the different possibilities here in a more detailled documentation soon. But for now, it may be very interesting to look at the example project and its code. The example project demonstrates most of the different capabilities of ShapeQRCode.

But for completeness, here’s a short comprehension of how to generate a QR code in Swift.

import ShapeQRCode

//use an emoji as the image in the middle
let 🦒 = "🦒".image()!

//create the image that should be contained in the qr code
let img = try? ShapeQRCode.Image(withUIImage: 🦒,
                                 width: 0.7,
                                 height: 0.7,
                                 transparencyDetectionEnabled: true)

//the actual struct that encapsulates the QR code data
let qr = ShapeQRCode(withText: "",
                     andImage: img,
                     shape: .circle,
                     moduleSpacingPercent: 0.002,
                     color: .black,
                     errorCorrectionLevel: .high)

//Render the qr code represented by the qr as an UIImage with 500px width/height
let renderedQRImage = qr.image(withLength: 500)                  

The final result looks like this:

QR code with giraffe and rounded dots as modules

You can find this code in the playground in this repo. Clone/Download the repo and open the workspace. Then build using "ShapeQRCode" scheme (important!) and run the playground.


For an example, where you can play around with the QR Code as well, see the sample project included in this repo.
The code used there may also help you to integrate the appropriate solution of a ShapeQRCode into your project.


Do you like that repo? Are there any issues? (obviously there’s a lot…) Submit a pull request, open an issue…
And: I’m always happy to hear your feedback! If you have any questions or suggestions, I’m glad to help you!


This project is licensed under the MIT License – see the LICENSE file for details


This library uses the great 🎉 QR Code generator library from Nayuki. Check it out! ➡️

Latest podspec

    "name": "ShapeQRCode",
    "version": "0.9.2",
    "authors": "Gero Embser",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "summary": "Swift QR code generator where the black squares can be replaced by shapes and images can be included in the QRCode",
    "source": {
        "git": "",
        "tag": "0.9.2",
        "submodules": true
    "platforms": {
        "ios": "12.0"
    "swift_version": "4.2",
    "source_files": [
    "private_header_files": [
    "pod_target_xcconfig": {
    "preserve_paths": "module.modulemap",
    "compiler_flags": "-w"

Pin It on Pinterest

Share This