目录
目录README.md

This library has been deprecated and the repo has been archived.

The code is still here and you can still clone it, however the library will not receive any more updates or support.

QRIO

Lightweight framework for QR scanning and generation

📝 Requirements

  • iOS 9.0+

📦 Installation

Carthage

github "nodes-ios/QRIO"

Cocoa Pods

pod "QRIO"

💻 Usage

Creating a QR Code:

It’s as easy as

let image = UIImage.QRImageFrom(string: "Hello World!")

This will return a UIImage:

HelloWorldQR

You can also adjust the size of the generated image, which will give you a clearer image, and the correction level, which adds more error protection, by using the optional parameters:

let image = UIImage.QRImageFrom(string: "Hello World!",
                containingViewSize: imageView.bounds.size,
                correctionLevel: "M")

HelloWorldQR

Scanning a QR Code:

You will need to create an instance of QRIO and maintain a strong reference to it:

let qrio = QRInput()

func scanForQR() {
    qrio.scanForQRImage() { (string) in
        print(string) // Prints "Hello World!" when using the QR codes above
    }
}

You can optionally pass a view to display the preview video in, and also a rect of interest to focus the detection.

let qrio = QRInput()

func scanForQR() {
    qrio.scanForQRImage(previewIn: previewContainer, rectOfInterest: hotspotView.frame) { (string) in
        print(string) // Prints "Hello World!" when using the QR codes above
    }
}

And that’s it! If you need to end QR scanning, you can call finish() on your QRIO object.

👥 Credits

Made with ❤️ at Nodes.

📄 License

QRIO is available under the MIT license. See the LICENSE file for more info.

邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号